- 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.

28th Nov 2021, 5:21 PM
Saman Salih
Saman Salih - avatar
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.
28th Nov 2021, 5:35 PM
Denise Roßberg
Denise Roßberg - avatar
+ 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
28th Nov 2021, 5:24 PM
Lisa
Lisa - avatar