0

Python

Error in executing student function: ValueError at line 1 invalid literal for int() with base 10: How can I fix this error?

8th Feb 2022, 3:17 AM
Knowledge Is Power
Knowledge Is Power - avatar
6 odpowiedzi
+ 4
Where is your code?
8th Feb 2022, 3:27 AM
A͢J
A͢J - avatar
+ 4
Knowledge Is Power I don't think it should depend on where you have been written. Where are you trying this code means on any other app?
8th Feb 2022, 3:36 AM
A͢J
A͢J - avatar
+ 3
Knowledge Is Power Code is right. What input you are providing? You can only enter 1, 3, 5, or 10 means whole integer number. You cannot enter number with decimal point.
8th Feb 2022, 3:30 AM
A͢J
A͢J - avatar
+ 2
It seems to work...
8th Feb 2022, 3:29 AM
CGM
CGM - avatar
0
sample_num = int(input()) def alg_fun(x): y = x**4 - 12*x**3 + 13*x**2 +11 return y print(alg_fun(sample_num))
8th Feb 2022, 3:27 AM
Knowledge Is Power
Knowledge Is Power - avatar
0
Thank you so much. Well i agree with both of the answers. I know its working. Does it depend on where its been posted? It does check the code too
8th Feb 2022, 3:34 AM
Knowledge Is Power
Knowledge Is Power - avatar