0
Is the code correct?
x= input ("enter x ") y= input ("enter y") if x>y: print ("x is greater than y") else: print ("y is greater than x") is the code correct and if not what's the correct code? the output to the above is: y is greater than x no matter that the two inputs is
6 Réponses
+ 3
Its working good.
Input on Playground should be separed by a enter (another line)
like this:
//param x
//param y
1
2
+ 2
You are doing something wrong.
you can paste it here and check it by yourself.
Check if your inputs are in the correct order in visual studio.
https://code.sololearn.com/#py
0
It looks correct to me, and it appears to work in the sololearn code playground and my linux terminal. I have to separate the inputs by a line in the playground though.
0
but here in visual studio the output is Y greater than X even if the if statement holds true
0
when I executed it in solo learn playground the code runs perfectly but in VS it's giving an error
0
aren't you comparing strings there? Looks to me like you should cast them to integers or floats