0

What is the bug in it

It is showing typeerror > can not be used with string or float

22nd Feb 2021, 6:59 AM
Pranay Sehgal
Pranay Sehgal - avatar
6 Antworten
+ 1
Line 1: Change to a=int(input())
22nd Feb 2021, 7:25 AM
Vadivelan
+ 1
If you want to allow your users to enter decimals, use float(input ()). If you only want to allow them to enter integers, use int(input()).
22nd Feb 2021, 8:07 AM
David Ashton
David Ashton - avatar
+ 1
If you want to print a message if the user causes a ValueError exception by a bad input, you will need to handle the exception with try/except https://www.sololearn.com/learning/2441/
22nd Feb 2021, 8:13 AM
David Ashton
David Ashton - avatar
0
Please provide your code.
22nd Feb 2021, 7:01 AM
你知道規則,我也是
你知道規則,我也是 - avatar
0
Ok
22nd Feb 2021, 7:07 AM
Pranay Sehgal
Pranay Sehgal - avatar
22nd Feb 2021, 7:15 AM
Pranay Sehgal
Pranay Sehgal - avatar