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

30 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+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents