Variables and Keywords in python
- Variables
Variables create a virtual location in RAM (Random Access Memory) for store data while running the program.
There are several rules in creating a variable.
- Variable name must starts with a letter or underscore. ( _ )
- Can't use reserved words (Keywords) as the variable name.
- Can not obtain the spaces.
- Variable can only have alpha-numeric characters and underscore. (a-z, A-Z, 0-9, _)
- There is no limit for the variable name.
- Keywords
Python has 36 key words.
if For make a condition
elif For use many condition statements
else For the last condition statement
for For create a loop
while For create a loop
True For Boolean true value
False For Boolean false value
and For logical operation
or For logical operation
not For logical operation
import For import a module
try For make try......except statement
raise For raise an exception
except When except occurs use with that
return Exit from a function with return value
def For make a function
class For make a class
Those are some of most usable keywords.
References :
Read more:
***
0 comments:
Post a Comment