CSC108H1 Lecture Notes - Lecture 1: Negative Number, Memory Address, Id1

109 views2 pages
10 Apr 2016
School
Course
yifanyang and 39659 others unlocked
CSC108H1 Full Course Notes
21
CSC108H1 Full Course Notes
Verified Note
21 documents

Document Summary

#when writing programs, we want to put in english language explanations called comments. Whatever comes after the # symbol is not evaluated. Two types of numbers: int and float. Division (/) produces a float since answer might not be an integer. // is integer division; produces an int. Order for precedence from highest to lowest. Symantic error: statement does not make sense since result is not defined. Min, max, abs (absolute value), pow, round. If you need help, help(whatever you need help with) e. g. help (pow) For power functions with 3 arguments, it becomes (x**y)%z. E. g. pow(2,3,5) becomes 23 % 5 = 8%5 = 3 (remainder 3 for 8/5) Min of 1 argument, max of 1 argument. If second argument is a negative number, round to the left: e. g. round(1234. 5678,-2) = 1200. 0. For rounding integers, round to nearest even integer. E. g. round(3. 5) = 4; round(4. 5) = 4.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents