Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #We provide you with a number N.
  2. #Create a list then, using a loop, populate the list with N elements. Set each list element to the index multiplied by 10.
  3. #Beware: we might pass in a value 0, in which case you should return an empty list.
  4.  
  5. # my code
  6.  
  7. # Get N from the command line
  8. import sys
  9. N= int(sys.argv[1])
  10.  
  11. List = []
  12.  
  13.  
  14. for x in range(0, N):
  15. List.append(x * 10)
  16. x += 1
  17.  
  18. print(List)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement