CISC 101 Chapter Notes - Chapter 4: Infinite Loop, Tab Key, User Interface

33 views14 pages

Document Summary

If part of the duplicated code has to be corrected or changed, the correction or change has to be done many times. Condition-controlled and count-controlled loops: two broad categories of loops: condition-controlled and count-controlled, a condition-controlled loops uses a true/false condition to control the number of times that it repeats, a count-controlled loop repeats a specific number of times. In python, you use the while statement to write a condition-controlled loop, and you use the for statement to write a count-controlled loop. If the condition is true, the statements that appear in the block following the while clause are executed and the loop starts over. If the condition is false, the program exists the loop: an execution of the statements in the body of the loop is called an iteration. It will never execute if its condition is false to start with.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents