Write a program to take x and y as input and output the string x, repeated y times. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write a program to take x and y as input and output the string x, repeated y times.

Solve

14th Feb 2022, 10:17 AM
Rakshita Yachalgar
8 Answers
+ 1
It is asked to take one string x and an integer y and then multiply x by y. Here int(input()) is to convert string into integer because input give string. so the code will be - x = input() y = int(input()) print(x*y)
14th Feb 2022, 10:35 AM
Shaurya Kushwaha
+ 4
Rakshita Yachalgar , please do a try by yourself first and post it here, since we are not sure what your issue is. thanks for your undertstanding!
14th Feb 2022, 10:20 AM
Lothar
Lothar - avatar
+ 1
x=input() y=int(input()) print(x*y) I think this is what you are talking about.
15th Feb 2022, 10:37 AM
okonkwo calistus
okonkwo calistus - avatar
0
x = input() y = input() print(x * 2)
14th Feb 2022, 10:26 AM
Rakshita Yachalgar
0
It's coming right for test case one And wrong for test case two
14th Feb 2022, 10:27 AM
Rakshita Yachalgar
0
Both have different numbers to output
14th Feb 2022, 10:27 AM
Rakshita Yachalgar
0
Thankyou!
14th Feb 2022, 10:40 AM
Rakshita Yachalgar
0
x = input() y = int(input()) print(x*y) ulululululu
3rd Mar 2022, 6:41 AM
Abednego Eka Chandra