what is the output of program in description and please explain | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what is the output of program in description and please explain

nums=[55,44,33,22,11] if all([i>5 for i in nums]): print("All larger than 5") if any([i%2==0 for i in nums]): print("Atleast one is even") for v in enumerate(nums): print(v)

17th Nov 2018, 7:06 AM
Priyanshu Ghatiya
Priyanshu Ghatiya - avatar
3 Answers
+ 5
Can you please describe where you don't understand?🤔
17th Nov 2018, 7:32 AM
Flandre Scarlet
Flandre Scarlet - avatar
+ 3
enumerate(list) return ghe list elements with order For example, strings = ["a", "bc", "def", "ghij"] for p in enumerate(strings): print(p) #(0, "a") #(1, "bc") #(2, "def") #(3, "ghij") for n, p in enumerate(strings): print(n, p[-1]) #0 a #1 c #2 f #3 j
17th Nov 2018, 10:07 AM
Flandre Scarlet
Flandre Scarlet - avatar
0
for v in enumerate(nums): print(v)
17th Nov 2018, 10:02 AM
Priyanshu Ghatiya
Priyanshu Ghatiya - avatar