Computer Science 1026A/B Lecture 1: Chapter 1

35 views1 pages
terubarenuka and 39895 others unlocked
COMPSCI 1026A/B Full Course Notes
26
COMPSCI 1026A/B Full Course Notes
Verified Note
26 documents

Document Summary

: repeatedly execute instructions while a condition is true. Example balance = 10. 0 target = 100. 0 year = 0 rate = 0. 025 while balance < target : year = year + 1 interest = balance * rate/100 balance = balance + interest. : a task is executed a task a definite # of times. : as long as the conditions is true the loop will continue, if untrue, the statement block is skipped. Example 1 counter = 1 # initialize the counter while counter <= 10: #check the counter print(counter) counter = counter + 1 #update the counter.

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