Upload
collaboration-technologies
View
116
Download
2
Embed Size (px)
Citation preview
Introduction to Python Basics Programming
www.collaborationtech.co.inBengaluru INDIA
Presentation By Ramananda M.S Rao
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
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
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
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
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
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
Introduction to Python Programming
Control Structure If and elif Statement While statement For Loop Break Statement Continue Statement
www.collaborationtech.co.in
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
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
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
About Us