-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariable.py
More file actions
34 lines (29 loc) · 768 Bytes
/
variable.py
File metadata and controls
34 lines (29 loc) · 768 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
#VARIABLES->Store information that can be used in the program
'''
iq = 190->Value 190 is stored in variable name iq->Binding of value
'''
#BEST PRACTICES
'''
1)snake_case->readibility increase->eg>user_iq
2)start with lowercase or underscore
3)letter, number,underscores
4)Case sensitive
)Don't overwrite keywords
'''
#MAKE THE VARIABLE NAME REALLY DESCRIPTIVE
#CONSTANT->VALUE DOEN'T CHANGE THROUGHTOUT THE PROGRAM
PI=3.14
#__ -> double underscore -> not us ein name if varibales -> dunder
#a,b,c=1,2,3->Rapidly assign value to variables multiple times.
#EXPRESSION VS STATEMENT
'''
iq = 100
user_age = iq / 5)->expression only iq/5
statement->the whole line-> user_age=iq/5
'''
#AUGMENTED ASSIGNMENT OPERATOR
'''
some_value=5
some_value+=2
print(some_value)
'''