0
#Question how to add elif in statement
a=int(input("Enter a number. ")) b=int(input("Enter a number. ")) print("a is bigger") if a>b else print(" b is bigger") #Question. how to add elif in above statement # output :- # Enter a number. 8 # Enter a number. 8 # b is bigger
6 Answers
+ 2
if(a>b):
print("a is bigger")
elif (a<b):
print("b is bigger")
else:
print(" a is equal to b")
+ 2
Thanks ravilnicki and all of us
0
Thanks for your immediate reply but I want all in one like this:
print("a is bigger") if a>b else print(" b is bigger")
0
Hey @aj I just want to know how to do that in one line