Get the information you need from a community of experts on IDNLearn.com. Get the information you need from our community of experts who provide accurate and comprehensive answers to all your questions.
Sagot :
THIS IS FOR PYTHON
total = 0
for i in range(8):
number = int(input('Number: '))
total += number
print(total)
The loop that will input 8 numbers from the keyboard and find the sum is as follows:
user_input = [int(input('Enter your value: ')) for i in range(8)]
print(sum(user_input))
The code ask for the user's input for 8 times. Recall the range is 8.
Then we loop through the users input values
The looped users input will be summed using the sum() function. The sum function sums all the users input value.
The summed value is then printed with the print statement.
learn more on loop: https://brainly.com/question/14201070?referrer=searchResults
We value your participation in this forum. Keep exploring, asking questions, and sharing your insights with the community. Together, we can find the best solutions. Thanks for visiting IDNLearn.com. We’re dedicated to providing clear answers, so visit us again for more helpful information.