Python Logo
- Python is strongly high-level language
- Python is interpreted
- Python is reflective
- Dynamically type
- Open-source
- Multiparadigm
Note: Sometimes we can say Python is a scripting language and very easy to write a program in python
Python is dynamically typed, which means the data types can be defined at the time of execution of the program.
Example
Value=2;
And value=’Ajay’;
(Show in the picture below)
Interactive Execution of Expression
Python programming language allows users to do words just like a calculator, you type an expression and python executes the expression immediately (within seconds).
Let’s go and check how it works.
Open python(command line) application shown in the picture below,
After launching application type expression for execution
>>>2+3
5 // this is the result of expression 2+3
(Shown in picture)
Key: Three right arrows (>>>) are the expression prompt telling python system is waiting for your expression
You can see the result of your expression, after pressing enter/return.
We can perform all arithmetic operations (shown in the figure).
Comments


- Like other languages, python also has the facility to comment on our statement and function, etc so the reader can understand functionality more easily.
- We give comments in python using a hash mark (#)
- Comments are ignored by python and used as information for the reader
Example: shown in the picture below.>>>3+2 #sum of two number.
Data Types in Python
- Integer
- Floating (float)
- String
- Boolean
Integer
- Integer stores any non-fractional number counting.
- Python does not upper boundary on the size of integer
- Size is also dependant on the number
- Example: the size of 5 is 12 bytes on the 32-bit operating system.
Size of 9999999 is 20 bytes on the 32-bit operating system. - An integer can be positive and negative both
- Float stores any fractional number.
- Python does not upper bound on the size of the float.
- Size of the float also depends on the number
- Python used scientific notation for float numbers.
1.2e3 means 1200.0
- String stores characters or sentence
- Python does not upper bound on the size of the string
- Size of string also depends on the length of string
- Boolean type represents a true or false value
True
>>> 2 > 5
False
Variables
Variables are just the name of a data type but reserved memory locations to store values for the different data types. This means that when you create a variable you reserve some space in memory.
Size of reserve memory depends on the data type of variable
Python allows you to assign a more than one variable at a time
Example: A=b=c=d=10;
Operators
Operators are the constructs which can manipulate the value of operands
Types of Operator
Python supports the following type of operator lists below,
- Arithmetic Operators
- Comparison Operators
- Logical Operators
- Bitwise Operators
- Assignment Operators
Arithmetic Operators
they are the following listed table.
b % a = 0
| Operator | Description | Example |
| + (Addition) | Performing addition of number | a + b = 30 |
| - (Subtraction) | Performing Subtraction of number | a – b = -10 |
| * (Multiplication) | Performing multiplication of number | a * b = 200 |
| / (Division) | Performing division of number | b / a = 2 |
| % (Modulus) | returns remainder | b % a = 0 |
| ** (Exponent) | Performs exponential (power) calculation on operators | a**b =10 to the power 20 |
Comparison Operators
assume a=10 and b=20



Ajay MalikPosted Jun 20, 2016, 1:58 PM
tq
Kuppurasu NagarajPosted Apr 30, 2016, 2:53 PM
Nice Sharing..
Ajay MalikPosted Apr 28, 2016, 12:24 PM
tq..Mohammed Ibrahim
Mohammed IbrahimPosted Apr 28, 2016, 12:21 PM
nice