CSC108H1 Study Guide - Midterm Guide: Computer Memory, Exclamation Mark, Id2
yifanyang and 39659 others unlocked
21
CSC108H1 Full Course Notes
Verified Note
21 documents
Document Summary
Python as a calculator: enter a equation, hit enter/return key to get answer, ex: 11+ 56. 67: can do addition, subtraction, multiplication, etc, * used to represent multiplication. Leave comment to know what you"re doing: use # #when writing programs, we want to put in english language explanations called comments: whatever is put after # symbol is not evaluated, ex: #11 + 56. 2. 0: why is there no decimal point in 20, float (floating point)- numbers that may have fractional part, floats are approximations. Integers (int)- numbers without fractional parts to real numbers: e. g. pi is infinite # but can use approximation. Use float for approximation: division (/) produces float result since answer might not be int, ex: 8/5.