CP104 Lecture Notes - Lecture 4: Boolean Algebra
![](https://new-preview-html.oneclass.com/Yaxkv7zyB48qN4baXwPzm20dL5M6XOgn/bg1.png)
- 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…)
![CP104 Full Course Notes](https://new-docs-thumbs.oneclass.com/doc_thumbnails/list_view/2140001-class-notes-ca-wlu-cp104-lecture3.jpg)
2
CP104 Full Course Notes
Verified Note
2 documents