- 1
What the frick? Beyond lost I tried everything ::/
Write a program to take x and y as input and output the string x, repeated y times. Sample Input hi 3 Sample Output hihihi Remember to convert the input to the required data type.
2 Réponses
+ 4
Hello Saman Salih
Python has a nice feature. Just try to print a string * a number and see what happens. Then you know how to solve this challenge.
+ 3
* take 2 inputs with the input function and store them in a variable
* make the 2nd input (the number) and integer using int()
* "multiply" the 1st input with the number to repeat the string
* print the result