What I have so far:
for c in range(3):
n = int(input())
n += n #tenho quase certeza que essa parte não está certa
print(n)
How to add multiple numbers that were typed in the output ?
What I have so far:
for c in range(3):
n = int(input())
n += n #tenho quase certeza que essa parte não está certa
print(n)
How to add multiple numbers that were typed in the output ?
You're doing overwrite to n
when you do n = int(input())
, do before:
total = 0
for _ in range(3):
n = int(input())
total += n
print(total)
Or with fewer rows / variables:
total = 0
for _ in range(3):
total += int(input())
print(total)
Python
style :total = sum(int(input()) for _ in range(3))