- 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]
2 ответов
+ 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.
+ 1
Thank you brother