Advertisement
SimeonTs

SUPyF Lists - 02. Multiply a List of Integers

Jun 15th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. """
  2. Lists
  3. Проверка: https://judge.softuni.bg/Contests/Practice/Index/924#1
  4.  
  5. 02. Multiply a List of Integers
  6.  
  7. Условие:
  8. Write a program to read a list of ints, a int p, multiply each item by p and print the resulting list.
  9.  
  10. Hints
  11. -Read the list
  12. -Loop through the list, multiplying each item by p
  13. -Finally, print the resulting list, using a for loop
  14. """
  15.  
  16. nums = [int(item) for item in input().split(" ")]
  17. multiply_by = int(input())
  18.  
  19. for item in nums:
  20.     print(f"{(item * multiply_by)}", end=" ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement