The problem is 15.2 in python beginner program | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

The problem is 15.2 in python beginner program

we have to make a program using input function for 2 things and the inputs are cool and 2 ,the output should be coolcool so here's what I did x=int(input()) y=input() print(x*y) when I ran the program it's showing error I'm stuck here. Please help.

26th Jan 2022, 5:50 AM
Ritesh Joshi
6 Answers
+ 3
To repeat a string we multiply <the-string> * <repetition Here <x> is repetition, and <y> is the string, just exchange their places ...
26th Jan 2022, 5:55 AM
Ipang
+ 3
Ipang Is this a new course because I didn't get this excercise in 15.2. That's is different excercise.
26th Jan 2022, 5:59 AM
A͢J
A͢J - avatar
+ 3
Maybe, you missed to convert variable y into an integer. y = int(input())
26th Jan 2022, 6:27 AM
Simba
Simba - avatar
+ 3
Ritesh Joshi Check order of inputs 1st you need to get string input then integer input x = input() y = int(input()) print (x * y)
26th Jan 2022, 6:30 AM
A͢J
A͢J - avatar
+ 2
thank you guys for your help ,now I've done it.
26th Jan 2022, 7:18 AM
Ritesh Joshi
+ 1
x is string y is a random number ,in the ques above I wrote x=int(input()) by mistake it still does'nt give the right answer
26th Jan 2022, 6:03 AM
Ritesh Joshi