Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!C:\Python32
- #filename: py4infoex2.4.py
- width = 17
- height = 12.0
- #For each expressions, write the value and type of the expression
- print (width/2)
- #expected value: 8 (int, since divisor not a float)
- #actual value: 8.5 (float division built into Python3.2, eh?)
- print (width/2.0)
- #expected value: 8.5 (float, since divisor is float)
- #actual value: 8.5
- print (height/3)
- #expected value: 4.0 (float, since divisor is float)
- #actual value: 4.0
- print (1 + 2 * 5)
- #expected value: 11 (int, since constants are ints; order of operations)
- #actual value: 11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement