I keep getting error each time I run this code. Any suggestions as to what I'm doing wrong?
10/19/2021 9:54:54 PM
Or you could do something like this:
grade = input()
grade = int(grade)
# your code
print("This is not a number")
Use float(input()) ,you might be using decimals
Is it working yet
I see that if put in float or string it gives error on sololearn but if i put input its fine
It depends on your input, if you type in a number it works fine.
But if you enter a string it raises an ValueError.
Dont see any error on what platform are you running the code sololearn?
Lz1234 visual studio code
Yeah, I've found an alternate way of putting it, thanks
You can use try and except to rise an exception if the user writes a string value
Print('not a number')
Send us a message