Robotics & Artificial Intelligence
To find the sum of whole numbers up to 10, a loop runs:
- once
- ten times
- eleven times
- any number of times
Python Control Flow
3 Likes
Answer
eleven times
Reason — Whole numbers start from 0. Therefore, the whole numbers up to 10 are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, which makes a total of 11 numbers. Hence, the loop runs eleven times.
Answered By
3 Likes
Related Questions
Which of the following loop does not need to check the condition before the execution begin?
- User controlled loop
- for
- while loop
- all
The purpose of the range function in a for loop is to ……………
- create a list of numbers
- define the start and end of the loop
- generate a sequence of numbers
- specify the step size of the loop
Using …………… loop, an infinite loop can be created.
- Fixed iterative loop
- while
- for
- all
A loop statement is given as:
for i in range(10):For how many times will the given loop statement be executed?
- none
- 9 times
- 10 times
- infinite