Update page 'Day 2 Homework - Karen'
@@ -1,7 +1,7 @@
|
|||||||
**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 #the literal "3" and the overall return "i" are both integer as `int`
|
i = 3 # the literal "3" and the overall return "i" are both integer as `int`
|
||||||
f = 3.0 # the literal "3.0" and the overal return "f" are both floating-point literal of type `float`
|
f = 3.0 # the literal "3.0" and the overal return "f" are both floating-point literal of type `float`
|
||||||
c = 3+3i # the literal "3" is an integer as `int` while the literal "3i" is a complex literal with 0 as the real part and the 3i as the imaginary part; the overal return c is a complex number of type `complex`
|
c = 3+3i # the literal "3" is an integer as `int` while the literal "3i" is a complex literal with 0 as the real part and the 3i as the imaginary part; the overal return c is a complex number of type `complex`
|
||||||
b = b'abcdefg' # the literal "b'abcdefg'" and the overall return "b" are both bytes literal of type `bytes`
|
b = b'abcdefg' # the literal "b'abcdefg'" and the overall return "b" are both bytes literal of type `bytes`
|
||||||
|
|||||||
Reference in New Issue
Block a user