+ 10

Can anyone help me solve this code?

here we can help you solve codes that you cannot solve

25th Dec 2020, 4:27 PM
Simone
Simone - avatar
38 odpowiedzi
+ 3
The input mentioned in the task description may be any integer number, not only 3 or 11. They are meant to be "user input". In the test cases, sololearn mimics such a user input. The program should be doing this: a + b = c 1. a and b is any number we get by 2 input()-calls 2. Cast a and b to be of type integer 3. Calculate c as the sum of a and b 4. Print c
25th Dec 2020, 6:44 PM
Lisa
Lisa - avatar
+ 4
a=int(input()) b=int(input()) c=a+b print(c) #remeber the value should be in integer not in float # I think that's the problem for you
27th Dec 2020, 1:30 PM
Antony Praveenkumar M
Antony Praveenkumar M - avatar
+ 2
25th Dec 2020, 4:38 PM
Krish
Krish - avatar
+ 2
Its a project pre-created for the module of the python's course. the module's name is "Strings & variables"
25th Dec 2020, 7:05 PM
Simone
Simone - avatar
+ 2
Okay, but without seeing the code I cannot tell where the assign error comes from. I know which task you mean. I just thought you might want to additionally save in playground because you can better test it there.
25th Dec 2020, 7:12 PM
Lisa
Lisa - avatar
+ 2
In python input() is used to input a string. To input other types of value you need to reassign the input ex. Int(input()) ,float(input()) ,eval(input()). The eval stands for evaluate, the program will process the user input and change to the most appropriate.
25th Dec 2020, 8:09 PM
Ri He
Ri He - avatar
+ 2
X =int(input()) Y =int(input()) Z=x+y Print(z)
27th Dec 2020, 8:53 AM
Avadh Darania
+ 1
Write this:- print(int(input())+int(input()))
27th Dec 2020, 11:28 AM
Mohammad Sefatullah
Mohammad Sefatullah - avatar
+ 1
a = input("") b = input("") c = int(a) d = int(b) print(c+d)
27th Dec 2020, 11:42 AM
K.S.S. Karunarathne
K.S.S. Karunarathne - avatar
+ 1
Just search python libraries bro. But ill search it myself for now. Don't you forget that nex step after understanding is learning stdanart library functions one by one.
27th Dec 2020, 11:53 AM
LineBreaker
LineBreaker - avatar
+ 1
a = int(input()) b= int(input()) print(a+b)
27th Dec 2020, 12:03 PM
Brian Kiprutto
Brian Kiprutto - avatar
0
Tashi N do you know that after a lesson there is practice? and ouch present that the course is divided into modules? good. at the end of the second Strings & Variables module there is a separate quiz called "END OF MODULE PROJECT Simple Calculator" I can't complete that quitz and i can't even share it.
25th Dec 2020, 5:36 PM
Simone
Simone - avatar
0
Hi Simone, You can copy your attempt, save it as public code snippet and link it here. When we see your code, we can try to help you. But from your description only it is not clear what your code is like.
25th Dec 2020, 6:08 PM
Lisa
Lisa - avatar
0
Hey Lisa I cant do it after many attempts I managed to share it https://www.sololearn.com/coach/615?ref=app
25th Dec 2020, 6:10 PM
Simone
Simone - avatar
0
Select all -> copy Then go to your profile -> code bits Tap "+" -> select python -> paste your code -> save it But if it is a short code snippet, you probably can copy to your post here directly. :)
25th Dec 2020, 6:16 PM
Lisa
Lisa - avatar
0
I did three attemps to solve it 1 a = 3 a += 6 b = 11 b +=22 print (a) 2 a = 3 a += 6 b = 11 b +=22 print (a) print (b) 3 a = 3 a += 6 b = 11 b +=22 print (a) print (b)
25th Dec 2020, 6:19 PM
Simone
Simone - avatar
0
Ok thanks
25th Dec 2020, 6:47 PM
Simone
Simone - avatar
0
No it doesnt function because if i add an user input it dont insert the user's number
25th Dec 2020, 6:50 PM
Simone
Simone - avatar
0
a = input() b = input() ?
25th Dec 2020, 6:56 PM
Lisa
Lisa - avatar
0
Yes ok but don't let me enter the numbers
25th Dec 2020, 6:57 PM
Simone
Simone - avatar