Nate Brunelle Today: Values and Types CS1110 Nate Brunelle Today: Values and Types
Questions?
Last Time Turtles drawing pictures
Silly Words Silly Bubble Jiggle Blub Plumbus
Values A “thing” 5, ½, Every value has a type
Values and Types Value Type Operators 5, 10, 0, 319, -30 int 3+7, 3-7, 3*7, 3/7 0.5, 3.1415926 55555.234 10.0 float 0.5+0.75, 0.2-1.7, 11.5*12.3, 3.2/9.8 ‘hi’ str ‘hi’+’bye’ bubble variables = print input function (): do the thing
Name/Variable/Identifier [Letter or _] [Letters or _’s or numbers] Things not allowed: Periods, hyphens, spaces, …. name = [some value] Assignment operator Gives meaning to the value Other contexts: Refers to the name we defined it to me 3 + name Use the value we assigned in the place of ‘name’
Functions Print Input