+ 1
i= int(input('Give me number!')) x = i + 10 nums=[ ] while i <= x: nums.append(i) i += 1 print(nums) Pls.e
Pls.explain role of nums = [ ] and nums.append(I)
4 Réponses
+ 3
[] created an empty list
nums.append(l) add l to the list.
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2431/
https://www.sololearn.com/learn/Python/2433/
+ 3
Sushil Mundhra , i suggest you to continue in the phyton course or repeat some lessons. All items you asked for are mentioned and demonstrated in the sololearn python tutorial.
+ 1
Better to do as following:
since we got i,
nums =[j for j in range(i, i+11)]
0
Thnx to all. Lothar i started repeat.