2. What makes python interesting !!
PYTHON CODE IS
AUTOMATICALLY
COMPILED TO BYTE CODE
AND EXECUTED,
IT’S SUITABLE FOR WEB
DEVELOPMENT , DATA
ANALYTICS AND CLOUD
CONFIGURATION.
IT CAN BE EXTENDED IN C
AND C++, PYTHON CAN
PROVIDE THE SPEED
NEEDED FOR EVEN
COMPUTE INTENSIVE
TASKS.
REPL == READ EVALUATE
PRINT LOOP
3. Why Python ?
Why named as python ? – famous TV
show Monty Python’s Flying circus , a
BBC comedy series
Usage
a)Shell scripting
b)Game programming
c)Windows development
d)Testing code
e)Web development
f)Analytics
4. Special Features
• Interpreter
• Supports Object Oriented Programming
• Other Libraries also include in python very easily
• Open source
• Version of python
• Cython C
• Jython Java
• IronPython .Net
• Pyspark Apache Spark
12. Python Summary
IMPORTING
PYTHON
LIBRARY
IMPORT
MODULE, FROM
MODULE
IMPORT
FUNCTION .
FOR HELP
HELP().
SCALAR TYPES
AND VALUES
INT , FLOAT
, NONE AND
BOOL.
RELATIONAL
OPERATORS ==
, != , <= , >= <
, >.
CONDITIONAL
STATEMENTS
WITH IF ... ELIF
... ELSE.
WHILE LOOPS BREAKING OUT
OF LOOPS WITH
BREAK
13. Python
Vs. other
language
• // C# or Java
• Int answer = 100;
• String name = “Hello”;
• # Python
• answer = 100
• name = " Hello"
15. OOPS in Python !!
Class Object
Methods Inheritance
Encapsulation Polymorphism
16. Control Flow
Statement
While For
count = 0 ; for_loop = [1,2,3,4,5]
while count < 10: for x in for_loop:
print(count) print(x)
count +=1 else:
print("loop completed )
Breaking Statement
training="python"
while True:
inp=input("Enter the Training Details")
if (inp!=training):
print ("Please enter the correct session ")
elif(inp==training):
print("Welcome to python session ")
break
18. Function + Module
Function :-
def welcome_to_tcube(username, greeting):
print("Hello, %s , from TCUBE Training !, Thanks for attending %s"%(username,
greeting))
Result :-
welcome_to_tcube('Senthil Kumar' ,'Python Session’)
Hello, Senthil Kumar , from TCUBE Training !, Thanks for attending Python Session
Module :-
We have to save the above function as tcubeFunction.py
From tcubeFunction import welcome_to_tcube