Create program | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Create program

If I have one list t1=[ 'january' 'february' ' march'] and this one t2=[ 31 , 30 , 31] so I want some program that creat t3 and do that in t3 3very single month be followed by his corresponding number of day so like this t3 =[ 'January' : 31 , 'February' : 30 , 'march' : 30]

27th Nov 2019, 6:42 AM
Vlädïmïr Sërgüëïl
Vlädïmïr Sërgüëïl - avatar
2 Answers
+ 2
If your 2 basic lists should be put together position by position, you can use zip() function. Syntax is : new_list = zip(list1, list2) new_list is a list that contains tuples with the “grouped" pairs. You can also use more than two lists to put them together. Use list() around zip-function, otherwise you will get a zip-object as result.
27th Nov 2019, 6:58 AM
Lothar
Lothar - avatar
+ 1
Thank you brother
21st Dec 2019, 11:25 PM
Vlädïmïr Sërgüëïl
Vlädïmïr Sërgüëïl - avatar