0
Why does my code output error?
In using python code and I input this: x= input('cool') y= int(input(2)) print (x*y)
4 Answers
+ 1
On python compiler it work just fine.
You probably didnt entered all input at once, here on sololearn we need to give all inputs when asked for it.
Also it will print text you write inside input.
In python compiler it is expected to be diferent, to ask question inside input(), then wait for user input, then assign this value to variable.
So i suggest to place comments in your code about what you expect as input value, and just use empty input, this is how you will have clear console on sololearn, with just output of your code. Something like
# enter some text
x = input()
# enter number
y = int(input())
print(x*y)
Run this code to learn how to add input in sololearn:
https://code.sololearn.com/WhiNb9BkJUVC/?ref=app
+ 1
It's not necessary to add extra prompt messages in your solution.
x = input()
y = int(input())
0
What error you getting? What is your expected output?
0
Do you know what the line input('cool') does?
It simply prints `cool` on the console
But, you are expecting the output to be `coolcool` which is not possible from your current code