+ 1
Why is this not working?
https://code.sololearn.com/cM44niAcbe3m/?ref=app I'm beginner. Can somebody explain me what's the problem?
9 Answers
+ 2
There is specific way to call a function ... I think you're not calling it properly that's why you are getting error . Although the code is absolutely right !
+ 4
It's working fine.. What you find wrong?
+ 2
Hope it solved...
You're welcome..
+ 1
Traceback (most recent call last):
File "file0.py", line 1, in <module>
x = int(input())
ValueError: invalid literal for int() with base 10:
i have this message
+ 1
What is your input,. It must be an integer because you are converting to input into intinger
ex:
imput :
2
3
outputs :
5
+ 1
Thank you)
0
"""You must be trying to add floats here simple fix
"""
x = input()
y = input()
def sum(a,b):
return a + b
try:
z = sum(float(x), float(y))
except ValueError:
print("enter a number a number dummy")
else:
print(int(z))
0
What is the problem in this, it is working perfe t
0
It's working I think your problem is that you just enter one input value to fix that try this:
Type your first value then press the enter key and then type your second value then run it