Top Banner
Introduction to Python Basics Programming www.collaborationtech.co.in Bengaluru INDIA Presentation By Ramananda M.S Rao
12

Introduction to Python Basics Programming

Apr 13, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Python Basics Programming

Introduction to Python Basics Programming

www.collaborationtech.co.inBengaluru INDIA

Presentation By Ramananda M.S Rao

Page 2: Introduction to Python Basics Programming

Introduction to Python ProgrammingContentIntroductionApplications and FrameworksGet Started with programmingVariables and Data Types Operators and Expressions Control Structure Sequence Types Dictionaries and Sets List ComprehensionsFunctionsLocal, Non Local & Global VariablesAnonymous and Lambda Functions

www.collaborationtech.co.in

Page 3: Introduction to Python Basics Programming

Introduction to Python ProgrammingIntroduction 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

Page 4: Introduction to Python Basics Programming

Introduction to Python ProgrammingGet Started with Python programIDLE helps you program in Python by:color-coding your program codedebuggingauto-indentinteractive shell

www.collaborationtech.co.in

Page 5: Introduction to Python Basics Programming

Introduction to Python ProgrammingGet Started with Python program#one.pyx = 34y = '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:34HelloWorld

# kbinput.pyname = input('What is your name:')

print('It is good to meet you mr ', name)www.collaborationtech.co.in

Page 6: Introduction to Python Basics Programming

Introduction to Python Programming# Data Format exampleage = 25name = 'Swaroop'print('{0} is {1} years old'.format(name, age))print('Why is {0} playing with that python?'.format(name))data=1/6print('{0:.3}'.format(data) ) # decimal (.) precision of 3 for float# fill with underscores (_) with the text centered (^) to 11 widthprint('{0:_^11}'.format('hello') )print( '{name} wrote {book}'.format(name='Swaroop', book='A Byte of Python') )

www.collaborationtech.co.in

Page 7: Introduction to Python Basics Programming

Introduction to Python Programmingperson = input(’Enter your name: ’)greeting = ’Hello {}!’.format(person)print(greeting)#Another Exampleapplicant = 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

Page 8: Introduction to Python Basics Programming

Introduction to Python Programming

Control Structure If and elif Statement While statement For Loop Break Statement Continue Statement

www.collaborationtech.co.in

Page 9: Introduction to Python Basics Programming

Introduction to Python Programming# Using If and elif Statement - compute.pya = 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

Page 10: Introduction to Python Basics Programming

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

Page 11: Introduction to Python Basics Programming

Follow us on SocialFacebook: https://www.facebook.com/collaborationtechnologies/Twitter : https://twitter.com/collaboration09Google Plus : https://plus.google.com/100704494006819853579LinkedIn : https://www.linkedin.com/in/ramananda-rao-a2012545Instagram : https://instagram.com/collaborationtechnologiesYouTube : https://www.youtube.com/channel/UCm9nK56LRbWSqcYWbzs8CUgSkype : facebook:ramananda.rao.7WhatsApp : +91 9886272445

www.collaborationtech.co.in

THANK YOU

Page 12: Introduction to Python Basics Programming

About Us