Whats wrong? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Whats wrong?

a=input() b=input() c=a+b print (c)

8th Feb 2020, 9:40 AM
Š”Š°ŃˆŠ° Š”ŃƒŠ¼Š¾Š²
Š”Š°ŃˆŠ° Š”ŃƒŠ¼Š¾Š² - avatar
4 Respostas
+ 9
The input will take a string value. So if you enter a=1 and b=2, c will print "12". You can wrap it in either the int() or float() to get the correct sum. a=int(input()) b=int(input()) c=a+b print(c) #3
8th Feb 2020, 9:58 AM
Duncan
Duncan - avatar
+ 6
Only input () will take String value so you should do typecast with int like this int(input()) for numeric value
8th Feb 2020, 9:44 AM
AĶ¢J
AĶ¢J - avatar
+ 5
Indentation 3rd line's wrong. What do I win?
8th Feb 2020, 10:07 AM
HonFu
HonFu - avatar
+ 2
hey.... u did itšŸ‘šŸ‘
8th Feb 2020, 12:47 PM
Oma Falk
Oma Falk - avatar