CSE 1010 Lecture Notes - Lecture 6: Boolean Expression

45 views3 pages
Verified Note

Document Summary

Else: alternate: activates if the previous expression fails. Check condition 1: if true, do consequent1 and skip the rest, if false, defer to the alternate, which is de ned by the else statement. An easy way to repeat a statement or group of statements a certain number of times. Loop is the noun, verb is iterate. Can contain any number of indented statements. Only form of the while loop, no else or elif. Statements are executed repeatedly as long as the condition is true. 4. return to step 1; test the condition. Loops and lists are frequently used together. Assignment statements are often used to increment the list. Assignment statement: evaluate the expression on the right hand side, store it in the variable on the left hand side. Whatever number n is, the function will increase it by 1: works with any variable (x,count,years)

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