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

Simple calculator

For the simple calculator, I wrote: x = int(input()) y = int(input()) #calculates the amount total = (x + y) print(total) Use to pass the challenge if you'd like. Does this look right to everyone else? Is there a better way?

7th Jan 2022, 6:16 PM
Jason Janis
4 Respostas
+ 1
x=int(input()) y=int(input()) print(x+y) Or print(int(input())+int(input()))
8th Jan 2022, 3:05 AM
NEZ
NEZ - avatar
0
a = input("first number: ") or '2' b = input("second number: ") or '3' print(f'{int(a)+int(b)}') print(eval(a+'+'+b)) print(int(a)+int(b))
7th Jan 2022, 6:24 PM
Shadoff
Shadoff - avatar
0
So what is your question?
7th Jan 2022, 6:44 PM
AĶ¢J
AĶ¢J - avatar
0
NEZ, I really like your reply. Thank you for the help
8th Jan 2022, 10:20 PM
Jason Janis