CSCA08H3 Lecture 8: Lecture Notes for Midterm from W1 to W8

70 views19 pages
3 Nov 2015
School
Course
Professor

Document Summary

Basic types in python: type( ) < class " > print( ) str( ) String (just a special way of saying a line of text) print( 4 + 5 ) 45 print(4+ 5 ) (crash!) print( hello *3) hellohellohello print( my mark was: +str((3+5+7)/30)) my mark was:0. 5. True=1 false=0 print( hello *true) hello print( hello *false) (an empty line!) print(3+true) 4 print(3+false) 3. None type (a special type for denoting we don"t want anything here) Form: input(prompt) prints the prompt, and waits for the users to type something user_input=input( please type something: ) print( you typed: +user_input) You typed: (whatever the user types as a string) != not equal to is the same object as ( same memory location) print(type(true)) print(type(true)) print(1<1) x=3 y=4 print(x+4==7-1) True x=4 y=4. 0 print(x is y) print(a>b) print(a

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