>>> number, factor = input().split() 280 2 >>> [number]*int(factor) ['280', '280']
Remember that combining a list with itself with the * operator may have unexpected results if your list contains mutable elements, but in your case this is normal.
edit:
A solution that can handle inputs without a factor:
>>> def multiply_input(): ... *head, tail = input().split() ... return head*int(tail) if head else [tail] ... >>> multiply_input() 280 3 ['280', '280', '280'] >>> multiply_input() 280 ['280']
Add error checking as necessary (for example, for empty inputs) depending on your use case.
source share