0
Read 15 numbers typed by the user and calculate the average values between x and y positions (inclusive).
I started trying to do...
numeros = []
for i in range (1, 16):
numeros.append(int(input(f"Digite o {i} Número: ")))
x = int(input("Entre com o limite Superior 'x':"))
y = int(input("Entre com o limite Inferior 'y':"))
somatorio = 0
for s in range(x, y+1):
somatorio = somatorio + numeros[s]
print(f"O somatório é: {somatorio}")
But I can’t even make my summation make the right calculation. I know it’s a lot of very basic beginner stuff, but if you can help, I’d appreciate it!
Daniel, the site supports syntax code in the questions, just use the button
{}
editor. Could [Edit] fix this by posting the code? Already let me know you’re settingsomatorio
as 0 within the loop and that its upper bound turned the lower and vice versa.– Woss
Please do not post the image code. Ask the [tour] and edit the question.
– danieltakeshi