Class Xi - Python Fundamentals Notes
Class Xi - Python Fundamentals Notes
Advantages of Python
• Easy to use
• Expressive Language
• Interpreted Language
• Cross-Platform Language
• Free and Open source Language
Disadvantages of Python
sep: The sep parameter of the print() function is used to specify the separator
between the values. The default value of sep parameter is space. (‘ ‘)
end: The end parameter is a useful feature of the print() function in Python
that can be used to control the formatting of output in various ways. The
specified string will be appended after the last value in the print ().The default
value of end parameter is newline. (‘\n‘).
Variables
A variable is a named storage location whose values can be used and processed
during the program run.
Eg: >>>x=3
>>>y=4
>>>z=x+y
>>>x=y
>>>y=5
A variable has three main components:-
1. Identity of the variable
It refers to the address in the memory which does not change once it
has been created. The address of a variable can be checked using the function
id().
Syntax:-
>>>id (variable name)
Eg:- >>>x=100
>>>id(x)
1614996384; which is the address of memory location storing the value 100.
➢ There should be one and only one variable on the left hand side of the
assignment operator. This variable is called Left-value or L-Value ➢
There can be any valid expression, literal or variable on the right hand
side of the assignment operator .This expression in called the
Rightvalue or RValue.