i= int(input('Give me number!')) x = i + 10 nums=[ ] while i <= x: nums.append(i) i += 1 print(nums) Pls.e | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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)

24th Oct 2020, 2:04 AM
Sushil Mundhra
4 Answers
24th Oct 2020, 2:17 AM
你知道規則,我也是
你知道規則,我也是 - avatar
+ 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.
24th Oct 2020, 8:29 AM
Lothar
Lothar - avatar
+ 1
Better to do as following: since we got i, nums =[j for j in range(i, i+11)]
24th Oct 2020, 3:03 AM
Shadoff
Shadoff - avatar
0
Thnx to all. Lothar i started repeat.
3rd Nov 2020, 1:34 AM
Sushil Mundhra