Update page 'Day 2 homework'
+6
-6
@@ -1,11 +1,11 @@
|
|||||||
1. Annotate the following python expressions with the specific types of each literal, as well as the overall return value:
|
1. Annotate the following python expressions with the specific types of each literal, as well as the overall return value:
|
||||||
|
|
||||||
* i = 3
|
* i = 3
|
||||||
* f = 3.0
|
* f = 3.0
|
||||||
* c = 3+3i
|
* c = 3+3i
|
||||||
* b = b'abcdefg'
|
* b = b'abcdefg'
|
||||||
* s = 'abcdefg'
|
* s = 'abcdefg'
|
||||||
* s = "abcdefg"
|
* s = "abcdefg"
|
||||||
|
|
||||||
2. For each of the types string, bytestring, integer, floating point, and imaginary literals, construct a 5x5 table showing what happens when the character "0" or number 0 is compared to each other type.
|
2. For each of the types string, bytestring, integer, floating point, and imaginary literals, construct a 5x5 table showing what happens when the character "0" or number 0 is compared to each other type.
|
||||||
3. Now do the same thing for the + and == operators for each pair of types two other 5x5 tables.
|
3. Now do the same thing for the + and == operators for each pair of types two other 5x5 tables.
|
||||||
|
|||||||
Reference in New Issue
Block a user