forked from imnowdevops/ddc-material
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataypes.py
More file actions
42 lines (31 loc) · 955 Bytes
/
Copy pathDataypes.py
File metadata and controls
42 lines (31 loc) · 955 Bytes
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
# String's
str1 = "alpha"
str2 = 'beta'
str3 = '''gamma string'''
str4 = """delta string"""
# Numbers
num1 = 123
flt1 = 2.0
# List / Collection of multi datatype, enclosed in square brackets.
first_list = [str1, "DevOps", 47, num1, 1.5]
# Printing a List
print(first_list)
# Tuple/ Collection of multi datatype, enclosed in round bracket
first_tuple = (str1, "DevOps", 47, num1, 1.5)
# Printing a tuple
print(first_tuple)
# Dictionary/ Elements in the dictionary are always in pairs(Key:Value), curly brackets.
first_dictionary = {"Name":"Imran", "Weight":75, "Exercises":["Boxing", "Dancing", "Jogging"]}
# Printing a Dictionary
print(first_dictionary)
print("Variable first_list is a:", type(first_list))
print("Variable first_tuple is a:", type(first_tuple))
print("Variable first_dictionary is a:", type(first_dictionary))
# Boolean
x = True
y = False
# Printing Boolean
print(x)
print(y)
print("x is a ", type(x))
print("y is a ", type(y))