+ 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]
2 Antworten
+ 1
Thank you so much!!
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]