+ 1

Why is this not working?

https://code.sololearn.com/cM44niAcbe3m/?ref=app I'm beginner. Can somebody explain me what's the problem?

27th Mar 2022, 7:31 PM
Artem
9 Respuestas
+ 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 !
29th Mar 2022, 11:04 AM
Yusra
Yusra - avatar
+ 4
It's working fine.. What you find wrong?
27th Mar 2022, 7:33 PM
Jayakrishna 🇮🇳
+ 2
Hope it solved... You're welcome..
27th Mar 2022, 7:43 PM
Jayakrishna 🇮🇳
+ 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
27th Mar 2022, 7:39 PM
Artem
+ 1
What is your input,. It must be an integer because you are converting to input into intinger ex: imput : 2 3 outputs : 5
27th Mar 2022, 7:41 PM
Jayakrishna 🇮🇳
+ 1
Thank you)
27th Mar 2022, 7:43 PM
Artem
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))
27th Mar 2022, 7:56 PM
Ion Kare
Ion Kare - avatar
0
What is the problem in this, it is working perfe t
29th Mar 2022, 6:45 AM
Dikshant Sharma
Dikshant Sharma - avatar
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
29th Mar 2022, 5:50 PM
D4rk C0d3r