May-21-2020, 02:59 PM
When I execute this code:
1 9 25 49 81
I can't see why. The code comes from Geeks for Geeks website.
Thanks
list1 = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] num = 0 # using while loop while (num < len(list1)): # checking condition if num % 2 == 0: print(list1[num], end=" ") # increment num num += 1The output I am getting is:
1 9 25 49 81
I can't see why. The code comes from Geeks for Geeks website.
Thanks