-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpy_variables.py
58 lines (42 loc) · 961 Bytes
/
py_variables.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
51
52
53
54
#variable
# x = str(3) # x will be '3'
# y = int(3) # y will be 3
# z = float(3) # z will be 3.0
# b = bool(True) # b is of type Bool
# print(x)
# print(y)
# print(z)
# print(b)
x = "Hello World" # str
# x = 20 int
# x = 20.5 float
# x = 1j complex
# x = ["apple", "banana", "cherry"] list
# x = ("apple", "banana", "cherry") tuple
# x = range(6) range
# x = {"name" : "John", "age" : 36} dict
# x = {"apple", "banana", "cherry"} set
# x = frozenset({"apple", "banana", "cherry"}) frozenset
# x = True bool
# x = b"Hello" bytes
# x = bytearray(5) bytearray
# x = memoryview(bytes(5)) memoryview
# x = None NoneType
print (x)
# assign multiple values
# x, y, z = "Orange", "Banana", "Cherry"
# print(x)
# print(y)
# print(z)
#output variable
# x = "Python "
# y = "is "
# z = "awesome"
# print(x + y + z)
# print(x , y , z)
# x = "Python "
# y = 2
# z = "good"
# #print(x + y + z)
# print(x + str(y) + z)
# print(x , y , z)