+ 2

Why I get different result when I multiply index numbers

nums = [4,7,3,1] for x in nums:   print(x * 2) Output 8 14 6 2 nums = [1,2,3] print(nums * 3) Output [1,2,3,1,2,3,1,2,3]

12th Dec 2022, 2:06 PM
William A Cruz Mendoza
William A Cruz Mendoza - avatar
2 odpowiedzi
+ 1
Thank you so much!!
12th Dec 2022, 2:44 PM
William A Cruz Mendoza
William A Cruz Mendoza - avatar