0

Can anyone help with simple calculator project?

14th Aug 2021, 12:25 PM
Rukevwe
Rukevwe - avatar
8 ответов
+ 2
well. show your code first
14th Aug 2021, 12:33 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
+ 1
x and y are holding string type value ,convert it to int first for addition Rukevwe
14th Aug 2021, 12:58 PM
Abhay
Abhay - avatar
0
x = input(6) y = input(3) felix = int(x+y) print(felix) tried this, didn't work
14th Aug 2021, 12:50 PM
Rukevwe
Rukevwe - avatar
0
in your code, x and y are strings. so you need to convert them into integers while your input function. x = int(input()) y = int(input()) print(x+y)
14th Aug 2021, 1:00 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
0
still didn't work tho... any other ideas?
14th Aug 2021, 1:02 PM
Rukevwe
Rukevwe - avatar
0
what errors did you get?
14th Aug 2021, 1:06 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
0
it gave me 639 instead of just 9
14th Aug 2021, 1:09 PM
Rukevwe
Rukevwe - avatar
0
Hi Rukevwe! It's because, still you didn't remove 3 & 6 inside input function. Keep in your mind that Sololearn ide works little more different than other ides. We need to provide all inputs at one time. And prompt messages aren't working properly here. This is what I mentioned above. x = input() y = input() felix = int(x)+int(y) print(felix)
14th Aug 2021, 2:11 PM
Python Learner
Python Learner - avatar