0
I want to print the if statement by inputting 5, but unfortunately print the else statement, help me to print the if statement.
m = input() if m == round(4.9): print("m is rounded or approximated and equal to 5") else: print("m is rounded or approximated and not equal to 5")
3 odpowiedzi
+ 3
By default the return type of input() function is a string, so you need to cast the input value to integer if you are going to compare it with other integer.
m=int(input())
+ 1
Use m=int(input())
0
Use m=int(input())
Cause by default it is a string so then comparing it to a float
Oh no