-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasics.py
More file actions
19 lines (15 loc) · 862 Bytes
/
Copy pathBasics.py
File metadata and controls
19 lines (15 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# In python, variables are used to store data that can be used and manipulate throughout a program. A variable is created the moment you assign a value to it using the assignment operator ( = ).
age = 34 # integer
name = "Sarvesh" # string
cgpi = "8.00" # float
# Rules Of Defining a variable in Python :-
# Variable name must be start with a letter (a-z, A-Z) or an underscore (_).
# They can contain letters, numbers, and underscores.
# Variables names are case sensitive( age and Age are different).
# Avoid using Python Keywords (e.g., if, for, while ) as variable names.
# 34age = 4 # Invalid because variable cannot start witha a number
age = 32 # Valid because variable can start with a number
# a$$ge = 45 # Invalid because variables cannot special character other than underscore (_).
__age = 34
__nice_45 = 34
a_b_c_7 = "Sarvesh"