Printing x or y as inputs | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Printing x or y as inputs

How can this code prints the inputs of x and y when it runs. I want it to be run such as; if I give 5 to x and 7 to y, I want it to run it as “5 is lower than 7” x = input() y = input() if x > y: print("x is greater than y") elif x < y: print ("x is lower than y") elif x == y: print("x equals to y") print("Program Ended")

29th Sep 2019, 12:13 PM
Zoran Furkan Cömert
Zoran Furkan Cömert - avatar
3 Answers
+ 2
x = input() y = input() if x > y: print("{} is greater than {} ".format(x,y)) elif x < y: print ("{} is lower than {}".format(x,y)) elif x == y: print("{} equals to {}".format(x,y)) print("Program Ended")
29th Sep 2019, 12:22 PM
Krid Indu
Krid Indu - avatar
+ 2
Print("{}is lowe than {}".format(x,y))
29th Sep 2019, 12:19 PM
Krid Indu
Krid Indu - avatar
+ 1
Thank you for really quick help everyone. I appreciate it so much.
5th Oct 2019, 6:29 PM
Zoran Furkan Cömert
Zoran Furkan Cömert - avatar