+ 1

nums = [1, 2, 3] print(nums * 3) >>>123123123 how to revise and get >>>246

23rd Dec 2016, 6:01 AM
SealCLi
SealCLi - avatar
2 Réponses
+ 3
new_nums = [2*x for x in nums]
23rd Dec 2016, 6:20 AM
Rishi Anand
Rishi Anand - avatar
0
Probably not the best technical solution, but one my brain could follow: nums = [1,2,3] help = (nums[0]*100 + nums[1]*10 + nums[2]) print (help*2)
13th Jan 2017, 7:52 AM
Rudus
Rudus - avatar