Class Notes (806,734)
CSC108H1 (113)
Lecture

september 16 notes

2 Pages
99 Views

School
University of Toronto St. George
Department
Computer Science
Course
CSC108H1
Professor
Michelle Craig
Semester
Fall

Description
 min >>> min(-4,0) #gives minimum of number -4  show all the functions available in the system >>> dir(_ _builtins_ _)  shows all functions available from the media module >>> dir(media)  explains absolute values; help explain the given variable >>> help(abs) abs(…) abs(number) -> number return the absolute value of the argument >>> help(media.set_green) # shows the properties of function set_green(pix, b) set the blue value of Pixel pix to b  variables, can equal to any value; name is stored >>> age = 22 >>> print age 22 >>> age = 18 >>> print age 18 >>> print “age” age >>> print age + 3 21 >>> x = 3 * 4 +5 >>> print x 17  ex. program 1. print “my average on the BIO test was”, 87.5 / 112 * 100 2. 3. if 87.5 / 112 >= 90: 4. print “Awesome!” 5. elift 87.5 / 112 * 100 >= 70: # elift = tries first one first; if false move 6. # on to the next line 7. print “Doing fine!” 8. elift 87.5 / 112 * 100 >= 50: 9. print “So so” 10. elift 87.5 / 112 * 100 < 50: 11. print Uh oh!!”  using variables 1. average = 87.5 / 112 * 100 2. print “my average on the BIO test was”, average 3. 4. if average >= 90: 5. print “Awesome!” 6. elift average >= 70: # elift = tries first one first; if false move on to 7. # the next line, once successful jumps to end 8. print “Doing fine!” 9. elift average >= 50: 10. print “So so” 11. elift average < 50: 12. print Uh oh!!”  Assignment statement Form: variable = expression o Evaluated the expression on the RHS (the value of the expression is a memory address) o Sto
More Less

Related notes for CSC108H1

OR

Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Join to view

OR

By registering, I agree to the Terms and Privacy Policies
Just a few more details

So we can recommend you notes for your school.