RI Y2 CEP Lesson 3 Slides 2020
Uploaded by dontsueme · 10 December 2024
Preview
Lesson 3Hexadecimal . Iterations . Array: list . Useful functionsRandom Number Generator . Charles Babbage
Administrative•Lesson 6: Practical Test 1•Release of CA1 (Project) – Due Lesson 13
Hexadecimal – base 16
How to convert ? ( 16 à 10 )
How to convert ? ( 2 à 16 )
Try . . .•(10101000111)2 to hexadecimal.
format()
ord() , chr() >>> ord(‘A’)>>> 65
Let’s think . . .if True or true: print(‘true!’)if true or True: print(‘true!’)What’s the difference ?
Short-Circuit (Lazy) Evaluation•For logical and, if the first operand evaluates to false, then regardless of the value of the second operand, the expression is false.•For logical or, if the first operand evaluates to true, regardless of the value of the second operand, the expression is true.if n != 0 and 1/n < tolerance:if n != 0: if 1/n < toleranceIn the Python programming language, short-circuit evaluation is used. What if n = 0 ?
Content continues in the PDF.
Related notes
- SST (for revision practice) 2024 S3 Computing EOY P2 QP_FinalExam Papers · 2024
- Computing o level notes Notes/Practices · 2023
- BVSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 MSExam Papers · 2024
- CWSS Prelim P1 CPExam Papers · 2024
- BVSS Prelim P1 MSExam Papers · 2024

