-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPython_3Variables.py
More file actions
79 lines (65 loc) · 1.79 KB
/
Python_3Variables.py
File metadata and controls
79 lines (65 loc) · 1.79 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#What are Variables ?
"""
Variables : In which we store our data, just like a container ,and in program we manage them with each other and seperately
"""
"""
RULE1 :While writing the variable
ALWAYS ALWAYS ALWAYS
ALWAYS ALWAYS
ALWAYS
Start it with
an letter ==== [a,b,c,.........z] or [A,B,C,.........Z]
or
an Underscore _ ⭐⭐⭐⭐⭐
"""
"""
RULE2 : Variables are Case Sensitive
"""
"""
RULE3 : Reserved Keywords ⭐⭐⭐
Also note that the variable name we are naming to them shall not be same as the keywords
for example
if the variable name is
for = "Om"
then it will display syntax error
the following are the list of the keywords which we cannot use:
['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else',
'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise',
'return', 'try', 'while', 'with', 'yield']
"""
"""
⭐⭐⭐⭐⭐Important
Values or we can say the updated values varies the variables
"""
#Syntax of setting variable
"""
My name : OM
Age :21
10_class: 86.40
"""
print("RULE1")
My_name = "Om Bacchuwar"
_age = 21
print(My_name)
print(_age)
print("RULE2")
print("RULE2")
name = "Om"
Name = "Sagar"
print(name) #Om will be printed whose variable starts with n
print(Name) #Sagar will be printed whose variable starts with N
print(name,Name) #Here both the names will be printed
print("RULE3")
print("RULE3")
print("RULE3")
import keyword
print(keyword.kwlist)
print("Above words shall not be selected while assigning the names")
print("IMPORTANT")
print("IMPORTANT")
print("IMPORTANT")
print("IMPORTANT")
print("IMPORTANT look below")
age = 20
age = 21 #updated age
print(age) #hence it will give the output as 21 not 20 as 21 is the updated value.