hiexam
python-institute · PCAP · Q602 · multiple_choice · topic_1

What will be the value of the i variable when the while e loop finishes its execution? //IMG//

What will be the value of the i variable when the while e loop finishes its execution? //IMG//
  • A.1
  • B.0
  • C.2
  • D.the variable becomes unavailable
Explanation
initially i value is 0, while condition fails as not equal to 0 So, it enters into else block and execute the increment statement. Now i become 1

Reference: examtopics_top_comment

Practice with progress tracking

Sign in to track wrong answers, get spaced-repetition reminders, and run timed exam mode.