what should be the result | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what should be the result

print('welcome to addition calculator\n') x = input('press any number from 0-9\n' ) y = input('press any number from 0-9\n' ) z = x+y print(z)

10th Nov 2018, 7:43 AM
Thesixfeetvirgo
Thesixfeetvirgo - avatar
2 Answers
+ 7
Addition of two numbers which user has given as input.
10th Nov 2018, 8:05 AM
$hardul B
$hardul B - avatar
+ 4
In your code x and y are strings, so x+y is the concatenation of these strings. For instance '25'+'25'='2525'. Use int(input()) or float(input()) to get the numbers
10th Nov 2018, 8:07 AM
portpass