KnowledgeBoat Logo
|

Informatics Practices

Assertion (A): The range() method is used with both for and while loops.

Reasoning (R): By default, the values for start and step are 0 (zero) and 1 (one), respectively.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Python Control Flow

3 Likes

Answer

A is false but R is true.

Explanation
The range() function is used with for loops to iterate over a sequence of numbers, not with while loops. By default, the values for start and step are 0 (zero) and 1 (one), respectively.

Answered By

3 Likes


Related Questions