Advertisement
Spocoman

02. Multiples List

Jan 22nd, 2022
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. num = int(input())
  2. lenght = int(input())
  3. output = []
  4. for i in range(1, lenght + 1):
  5.     output.append(num * i)
  6. print(output)
  7.  
  8.  
  9. Или:
  10.  
  11. num = int(input())
  12. lenght = int(input())
  13. output = [x * num for x in list(range(1, lenght + 1))]
  14. print(output)
  15.  
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement