Source Program MachineLanguage
Compiler
Source Program Output
Interpreter
Output
Intermediate Code
COMPILER
A compiler is a special program that processes statements written in a
particular language and turns them into machine language.
INTERPRETER
An interpreter is a program that translates a programming language
into a comprehensible language
Source to Output
3.
One ofthe most widely used User-Friendly programming languages.
Easy To Learn programming language.
Python is a High Level language.
It is a Free and Open Source language.
Python is portable and platform independent, means it can run on
various operating systems and hardware platforms.
Python has a Rich Library of Predefined Functions.
Most Application Area
Machine learning
Artificial intelligence
Big Data
GUI based desktop applications
Robotics
Why Python ?
4.
Where to WritePython Code ?
1) Interactive mode :
Writing a python statement on the >>> prompt directly.
In shell we can run only one command at a time
2) Script mode :
Writing a Python program in a file (“.py” extension), save it and then
use the interpreter to execute it.
When we Run our program, the output will display at shell
Variables IN Python
Itis an object or an item or element that is stored in the memory.
Value of a variable can be a string, numeric or any combination of
alphanumeric characters.
7.
Input in python
Stringinput: Str = input(“Enter a string : ”)
Integer input: Val = int( input(“Enter a number : “) )
Float Input: num = float( input(“Enter a float : “) )
8.
A keyword isa word having special meaning reserved by python
programming language
False async del from lambda return
None await elif global nonlocal try
True break else if not while
and class except import or with
as continue finally in pass yield
assert def for is raise
Python Keywords
Arithmetic Operator
+ (Addition),- (Subtraction), * (Multiplication),
/ (Division), //(Floor Division), %(Remainder),
**(Power)
Relational Operator
> (Greater Than), < (Less Than),
>= (Greater Than or Equal), <= (Less Than or Equal),
== (Equality), != (Not Equality)
Assignment Operator =, +=, -=, *=, /=, //=, %=, **=
Logical Operator and or not
Identity Operator is is not
Membership Operator in not in
Python Operators
11.
MATHEMATICAL OPERATORS INPYTHON
Addition(+), Subtraction(-), Multiplication(*), Division(/), Modulus(%),
Power of Exponent (**), Rounding off (//)
14.
Built In FunctionsIN Python
There are some functions in Python which help us to reduce program lines
and effort. Some of the Built-in functions are -
15.
Comment line isusually written in English word to express what the program
or part of a program does.
o It is not a part of code.
o It is used to understand the code easily.
o Compiler does not compile a comment line.
Single line comment : ( # )
Multiline comment : (‘’’ …. ‘’’) or (“”” ….. “””)
* Actually these comment line used in python module
Comment Line IN Python