nerdexam
GIAC

GPYC · Question #69

What will be the value of the i variable when the while loop finishes its execution? i = 0 while i != 0: i = i + 1 else: i = i + 1

The correct answer is A. 1. You've hit your limit · resets 1pm (America/New_York)

Python Fundamentals & Command Line Tools

Question

What will be the value of the i variable when the while loop finishes its execution? i = 0 while i != 0: i = i + 1 else: i = i + 1

Options

  • A1
  • B0
  • C2
  • DThe variable becomes unavailable

How the community answered

(42 responses)
  • A
    76% (32)
  • B
    14% (6)
  • C
    2% (1)
  • D
    7% (3)

Explanation

You've hit your limit · resets 1pm (America/New_York)

Topics

#while loop#else clause#loop execution#control flow

Community Discussion

No community discussion yet for this question.

Full GPYC Practice