Open source general-purpose. Multiplatform programming language
Object Oriented, Procedural, Functional
Easy to interface with C/ObjC/Java/Fortran
Easy to interface with C++ (via SWIG)
Great interactive environment
Python 'philosophy' emphasis readability, clarity and simplicity
The Interactive Interpreter
it is very easy to learn and understand.
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Introduction to Python Basics Programming
1. Introduction to Python Basics
Programming
www.collaborationtech.co.in
Bengaluru INDIA
Presentation By
Ramananda M.S Rao
2. Introduction to Python Programming
Content
Introduction
Applications and Frameworks
Get Started with programming
Variables and Data Types
Operators and Expressions
Control Structure
Sequence Types
Dictionaries and Sets
List Comprehensions
Functions
Local, Non Local & Global Variables
Anonymous and Lambda Functions
www.collaborationtech.co.in
3. Introduction to Python Programming
Introduction
Open source general-purpose. Multiplatform programming
language
Object Oriented, Procedural, Functional
Easy to interface with C/ObjC/Java/Fortran
Easy to interface with C++ (via SWIG)
Great interactive environment
Python 'philosophy' emphasis readability, clarity and simplicity
The Interactive Interpreter
it is very easy to learn and understand.
It is extensible, you can easily plug new modules in your Python
installation and extend its functionality
www.collaborationtech.co.in
4. Introduction to Python Programming
Get Started with Python program
IDLE helps you program in Python by:
color-coding your program code
debugging
auto-indent
interactive shell
www.collaborationtech.co.in
5. Introduction to Python Programming
Get Started with Python program
#one.py
x = 34
y = 'Hello'
y = y + 'World'
print(x)
print(y)
Open new window and type in the program save as one.py and then run module.
Output:
34
HelloWorld
# kbinput.py
name = input('What is your name:')
print('It is good to meet you mr ', name)
www.collaborationtech.co.in
6. Introduction to Python Programming
# Data Format example
age = 25
name = 'Swaroop'
print('{0} is {1} years old'.format(name, age))
print('Why is {0} playing with that python?'.format(name))
data=1/6
print('{0:.3}'.format(data) )
# decimal (.) precision of 3 for float
# fill with underscores (_) with the text centered (^) to 11 width
print('{0:_^11}'.format('hello') )
print( '{name} wrote {book}'.format(name='Swaroop', book='A Byte of Python') )
www.collaborationtech.co.in
7. Introduction to Python Programming
person = input(’Enter your name: ’)
greeting = ’Hello {}!’.format(person)
print(greeting)
#Another Example
applicant = input(‘Enter the applicant’s name: ‘)
interviewer = input(‘Enter the interviewer’s name: ‘)
time = input(‘Enter the appointment time: ‘)
print(interviewer + ’ will interview ’ + applicant + ’ at ’ + time +’.’)
print(’{} will interview {} at {}’.format(interviewer, applicant, time))
www.collaborationtech.co.in
8. Introduction to Python Programming
Control Structure
If and elif Statement
While statement
For Loop
Break Statement
Continue Statement
www.collaborationtech.co.in
9. Introduction to Python Programming
# Using If and elif Statement - compute.py
a = input('enter value a:')
b = input('enter value b:')
x= int(a)
y=int(b)
ch = input('enter your option(1.add 2.subtract):')
choice= int(ch)
if choice == 1:
print('sum of ' + a + 'and ' + b +'=', x+ y )
elif choice == 2:
print ( ' subtraction of '+ a + ' and ' + b + 'is ' , x- y )
else:
print('Invalid Option:')
www.collaborationtech.co.in
10. Introduction to Python Programming
# Using for Statement
print('Using for loop Statement')
for x in range(20):
print('Still in the loop: ', x)
print('Outside of the for loop')
# for with range
for x in range(3,20):
print('Still in the loop: ‘, x)
print ('Outside of the loop')
val=input('enter the value for x')
x=int(val)
for i in range(x):
if(i%2==0):
continue
print(‘value:’,i)
print('done')
www.collaborationtech.co.in
11. Follow us on Social
Facebook: https://www.facebook.com/collaborationtechnologies/
Twitter : https://twitter.com/collaboration09
Google Plus : https://plus.google.com/100704494006819853579
LinkedIn : https://www.linkedin.com/in/ramananda-rao-a2012545
Instagram : https://instagram.com/collaborationtechnologies
YouTube :
https://www.youtube.com/channel/UCm9nK56LRbWSqcYWbzs8CUg
Skype : facebook:ramananda.rao.7
WhatsApp : +91 9886272445
www.collaborationtech.co.in
THANK YOU