CP104 Lecture Notes - Lecture 4: Boolean Algebra

56 views2 pages
School
Course
Professor
- In exam you can use whatever loop (for loop or while loop)
- No syntax errors from indentation in midterm-exam
- Do not use while loop o exam
Midterm
- Know if else and nested decision structure
- Is statement and boolean logic
Ex. python does not check for true it checks for false(stores 0)
x=5<4
If x:
print(“this is the true branch”)
else
print(“this is false branch”)
-true is always going to be executed
FOR LOOP
For num in[1,2,3,4,5,]:
Print (num)
- num=target variable
- USE FOR LOOP FOR RUNNING CALCULATIONS
- -first initialize item you are calculating(total,min…)
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in
hayjayshay and 38575 others unlocked
CP104 Full Course Notes
2
CP104 Full Course Notes
Verified Note
2 documents

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