-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path03.variables.py
More file actions
46 lines (37 loc) · 838 Bytes
/
03.variables.py
File metadata and controls
46 lines (37 loc) · 838 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
43
44
45
46
# 03. variables
####
# Python has no command for declaring a variable
""" Variable names cannot start with a number,
#it start with a letter (capital or small) or _ (underscore)
"""
# Variable names are case-sensitive which means (aA, Aa, AA, aa ) are four different vars
""" Python allows you to assign values to multiple variables in one line.
And you can assign the same value to multiple variables in one line.
"""
####
x = 5
y = "hello, world!"
print(x)
print(y)
z = 2
z = "myText" # change vars' type & save the new value
print(z)
# "" = ''
a = 'omar'
b = "omar"
print(a)
print(b)
c, d, e = "Var c", "Var d", "var e"
print(c)
print(d)
print(e)
f = g = h = "3 variables have the same value"
print(f)
print(g)
print(h)
i = 'Python is'
print(i+' fun')
j, k = "Python is ", "easy"
print(j+k)
print(5+5)
print(5+"text")