Sample problem for beginner | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Sample problem for beginner

Hey there, I’m just starting out and came across this sample problem. 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 I tried the solution of: x = input (‘Hi’) y = int(input(3)) print (x * y) And this does not work. Thanks ahead for any insight.

3rd Apr 2022, 4:44 PM
Luke Cushman
2 Answers
+ 2
try x = input() y = int(input()) print(x*y) https://code.sololearn.com/cCTJYOLeCr97/?ref=app
3rd Apr 2022, 4:45 PM
Infinity
Infinity - avatar
0
Got it. Thanks. Was thinking to deep into that.
3rd Apr 2022, 4:51 PM
Luke Cushman