-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatatype.py
50 lines (30 loc) · 1006 Bytes
/
datatype.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Use the int data type
# Use the float data type
# Use the complex data type
# Use the bool data type
print("Python has three numeric types: int, float, and complex")
myValue=1
print(myValue)
print(type(myValue))
#The str() function converts values to a string form so they can be combined with other strings.
print(str(myValue) + " is of the data type " + str(type(myValue)))
#float data type - number with a decimal
myValue=3.14
print(myValue)
#printing the type of value - float
print(type(myValue))
print(str(myValue) + " is of the data type " + str(type(myValue)))
#complex data types - a combo of int and a character
myValue=5j
print(myValue)
print(type(myValue))
print(str(myValue) + " is of the data type " + str(type(myValue)))
#bool data type
myValue=True
print(myValue)
print(type(myValue))
print(str(myValue) + " is of the data type " + str(type(myValue)))
myValue=False
print(myValue)
print(type(myValue))
print(str(myValue) + " is of the data type " + str(type(myValue)))