Movatterモバイル変換


[0]ホーム

URL:


Nicholas I, profile picture
Uploaded byNicholas I
294 views

Get started python programming part 1

This document provides an overview of Python programming concepts including the basics of Python, strings, control structures like if/else statements and loops, and input/output functions. It discusses what a program and programming are, gives an introduction to Python including its uses and installation. It then covers key Python concepts like variables, data types, operators, functions, modules and object-oriented programming.

Embed presentation

Downloaded 10 times
Python - Part 1Getting started with PythonTradeyathra - Stock market training and forecasting expertsNicholas I
AgendaIntroductionBasicsStringsControl StructuresList, Tuple, DictionaryFunctionsI/O, Exception HandlingRegular ExpressionsModulesObject Oriented Programming
Program & ProgrammingWhat is Python?Where It’s Used?InstallationPracticeIntroductionModule 1
A Program is a set of instructions that a computer follows to perform a particulartask.ProgramStep 1Plug the TV wire tothe electric switchboard.Step 2Turn your Tv on.Step 3Press the powerbutton on your TVremote.Step 4Switch between thechannels by directlyentering the numbersfrom your remote.How to turn on a tv with remote
Programming is the process of writing your ideas into a program using a computerlanguage to perform a task.ProgrammingProgramming languages
● It was created in 1991 by Guido van Rossum.● Python is an interpreted, interactive, object-oriented programming language.● Python is a high-level general-purpose programming language that can beapplied to many different classes of problems.● Python is portable: it runs on many Unix variants, on the Mac, and on Windows2000 and later● Easy to learn and understand.● Simple syntax and Flexible.What is Python?
Where it is used?Web and InternetDevelopmentScientific & Numeric Games Desktop GUISoftwareDevelopmentBusinessApplicationsCloud & Data CenterIoT, MachineLearning & AI
InstallationWindows● https://www.python.org/ftp/python/3.6.6/python-3.6.6rc1-webinstall.exe● Follow the wizard and finish the installation.● Setup the environment variables.Mac and Linux● Mac and Linux comes with python preinstalled.
PracticeTime to set-uppython on your system...
Questions & Answers
Interactive & Script ModeCommentsNumbersVariablesConstantsInput and OutputBasicsModule 2
Interactive & Script ModeScript ModeInteractive
Comments# Single Line Comment# multi# line# Comment""”Docstring is short for documentation string.It is a string that occurs as the first statement in a module, function, class, or method definition.We must write what a function/class does in the docstring."""
Numbersaddition >>> 8 + 513subtraction >>> 8 - 53multiplication >>> 8 * 513division >>> 8 / 513exponent >>> 4 ** 364negation >>> -2 + -4-6
Integer and Floatint >>> 3535>>>float >>> 30.530.5An int is a whole number A float is a decimal number
Order of Operations>>> ( 5 + 7 ) * 3 >>> 5 + 7 * 336 26PEMDAS: Parentheses Exponent Multiplication Division Addition Subtraction>>> 12 * 3 >>> 5 + 21
Variables>>> apples_in_box = 105Variable is the container that stores some value.>>> apples_sold = 5>>> apples_balance = apples_in_box - apples_sold510>>> fruit_box = 100variable name Value to be stored
Naming VariablesName your variables meaningful and As long as you’re not breaking these rules,you can name variables anything you want.no spaces = 0 X No spaces in the name3eggs, $price X No digits or special characters in front
ConstantsConstants are used to store a value that can be used later in your program. Thevalue of the constant remains same and they do not change.>>> PI = 3.14constant name Value to store>>> GRAVITY = 9.8
Input and Output>>> input([prompt])Function to acceptvalue from usersvia cliValue to beentered by user>>> print([output])Function to outputvalue to usersValue printed onthe user screen
String DelimitersConcatenationTriple quoted string literalsEscape CodesString MethodsStringsModule 3
StringsA string in Python is a sequence of characters. For Python to recognize asequence of characters, like hello, as a string, it must be enclosed in quotes todelimit the string.>>> "Hello"Note:A string can have any number of characters in it, including 0. The empty string is '' (two quote characters with nothingbetween them). Many beginners forget that having no characters is legal. It can be useful.>>> 'Hello'
ConcatenationThe plus operation with strings means concatenate the strings. Python looks atthe type of operands before deciding what operation is associated with the +.>>> "Firstname" + "lastname" >>> 'Hello'Firstnamelastname>>> 3 * 'Smart' + 'Phone'SmartSmartSmartPhone>>> 7 + "star"?
Note:The line structure is preserved in a multi-line string. As you can see, this also allows you to embedboth single and double quote characters!Triple Quoted String LiteralsStrings delimited by one quote character are required to be within a single line.For example: ‘hello’.It is sometimes convenient to have a multi-line string, whichcan be delimited with triple quotes, '''.
Note:The line structure is preserved in a multi-line string. As you can see, this also allows you to embedboth single and double quote characters!Escape CodesEscape codes are embedded inside string literals and start with a backslashcharacter . They are used to embed characters that are either unprintable orhave a special syntactic meaning to Python that you want to suppress.
String MethodsPython has quite a few methods that string objects can call to perform frequencyoccurring task (related to string). For example, if you want to capitalize the firstletter of a string, you can use capitalize() methodcapitalize() Converts first character to capital lettercount() Counts the occurrences of a substringupper() Returns uppercased stringlower() Returns lowercased stringlen() Returns length of a stringsplit() Separates the words in sentences.
split()
if , elif and elsewhileforbreakControlStructuresModule 4
if, elif & elseif condition:statementselse:statementif condition:statementselif condition:statementselse:statementsa = 0if a == 0:print('A is equal to 0')else:print('A is not equal to 0')a = 2if a == 0:print('A is equal to 0')elif a == 1:print('A is equal to 1')else:print('A is not equal to 0 or 1')Theif…elif…elsestatement isused fordecisionmaking.Syntax SyntaxRun Run
Loginuname = 'admin'pword = 'admin'# user to enter their usernname & passwordusernname = input('username: ')password = input('password: ')if usernname == uname and password == pword:print('Login successful')else:print('Sorry! Invalid username and password')
whileRun the statements until a given condition is true.while condition:statementSyntaxmovie = 'Spider Man'while movie == 'Spider Man':print('Yes! I am Spider Man')breakRun
forLoops through elements in sequence & store in a variablethat can be used later in the program.for variable in sequence:statementSyntax
for# print 0-9 numbers using for loopfor number in range(10):print(number)Run# print all the elements in fruits listfruits = ['apple','banana','orange']for fruit in fruits:print(fruit)Run
for - nestedcountries = ['India','US','China','Europe']fruits = ['apple','banana','orange']for country in countries:for fruit in fruits:print(country,':', fruit)print('-----------------')Run
breaka = 0while a==0:print('hello')Runa = 0while a==0:print('hello')breakRun
Nicholas ITradeyathranicholas.domnic.i@gmail.comCall / Whatsapp : 8050012644Telegram: t.me/tradeyathraThank You

Recommended

PPTX
Python final presentation kirti ppt1
PPT
Introduction to Python
PPTX
Basics of python
PDF
Introduction to python 3 2nd round
PDF
Introduction to python 3
PPTX
Python - Lesson 1
PPTX
Python Tutorial for Beginner
PPTX
GDG Helwan Introduction to python
ODP
Python Presentation
PPT
Python ppt
PPTX
Learn Python The Hard Way Presentation
PPTX
Python - An Introduction
PPT
Python - Introduction
ODP
Introduction to programming with python
PDF
Let’s Learn Python An introduction to Python
PPTX
Beginning Python Programming
PPTX
Learn python – for beginners
PPTX
Introduction to python
PPTX
Python basics
PPTX
Introduction to Python Basics Programming
PPTX
Python-00 | Introduction and installing
PPT
Why I Love Python
 
PDF
File handling & regular expressions in python programming
PPTX
Phython Programming Language
PDF
Introduction To Python | Edureka
PPTX
Python Tutorial Part 2
PPTX
Python 101
PPTX
unit1.pptx for python programming CSE department
PDF
Notes1
 

More Related Content

PPTX
Python final presentation kirti ppt1
PPT
Introduction to Python
PPTX
Basics of python
PDF
Introduction to python 3 2nd round
PDF
Introduction to python 3
PPTX
Python - Lesson 1
PPTX
Python Tutorial for Beginner
PPTX
GDG Helwan Introduction to python
Python final presentation kirti ppt1
Introduction to Python
Basics of python
Introduction to python 3 2nd round
Introduction to python 3
Python - Lesson 1
Python Tutorial for Beginner
GDG Helwan Introduction to python

What's hot

ODP
Python Presentation
PPT
Python ppt
PPTX
Learn Python The Hard Way Presentation
PPTX
Python - An Introduction
PPT
Python - Introduction
ODP
Introduction to programming with python
PDF
Let’s Learn Python An introduction to Python
PPTX
Beginning Python Programming
PPTX
Learn python – for beginners
PPTX
Introduction to python
PPTX
Python basics
PPTX
Introduction to Python Basics Programming
PPTX
Python-00 | Introduction and installing
PPT
Why I Love Python
 
PDF
File handling & regular expressions in python programming
PPTX
Phython Programming Language
PDF
Introduction To Python | Edureka
PPTX
Python Tutorial Part 2
PPTX
Python 101
Python Presentation
Python ppt
Learn Python The Hard Way Presentation
Python - An Introduction
Python - Introduction
Introduction to programming with python
Let’s Learn Python An introduction to Python
Beginning Python Programming
Learn python – for beginners
Introduction to python
Python basics
Introduction to Python Basics Programming
Python-00 | Introduction and installing
Why I Love Python
 
File handling & regular expressions in python programming
Phython Programming Language
Introduction To Python | Edureka
Python Tutorial Part 2
Python 101

Similar to Get started python programming part 1

PPTX
unit1.pptx for python programming CSE department
PDF
Notes1
 
PPTX
Python basics
PPTX
Python basics
PPTX
Python basics
PPTX
Python basics
PPTX
Practice Program-1.pptx.
PPTX
Practice Python Program-1.pptx
PPTX
Python begginer Practice Program-1.pptx
PPTX
Python ppt
PPTX
UNIT 4 python.pptx
PPTX
An Introduction To Python - Python Midterm Review
PDF
python_strings.pdf
PPTX
Python Strings and strings types with Examples
PPTX
Python basics
PPTX
Python basics
PPTX
Python basics
PPTX
Python
PDF
ACM init() Spring 2015 Day 1
PDF
Python intro
unit1.pptx for python programming CSE department
Notes1
 
Python basics
Python basics
Python basics
Python basics
Practice Program-1.pptx.
Practice Python Program-1.pptx
Python begginer Practice Program-1.pptx
Python ppt
UNIT 4 python.pptx
An Introduction To Python - Python Midterm Review
python_strings.pdf
Python Strings and strings types with Examples
Python basics
Python basics
Python basics
Python
ACM init() Spring 2015 Day 1
Python intro

Recently uploaded

PDF
FAMILY ASSESSMENT FORMAT - CHN practical
PDF
Ketogenic diet in Epilepsy in children..
DOCX
Mobile applications Devlopment ReTest year 2025-2026
PPTX
How to use search_read method in Odoo 18
PPTX
The Art Pastor's Guide to the Liturgical Calendar
PPTX
Rectal Surgery in Senior Citiizens .pptx
PPTX
Pig- piggy bank in Big Data Analytics.ppt.pptx
PDF
The Pity of War: Form, Fragment, and the Artificial Echo | Understanding War ...
PPTX
Vitamins and mineral deficiency , signs and symptoms associated with exercise
PDF
Models of Teaching - TNTEU - B.Ed I Semester - Teaching and Learning - BD1TL ...
PPTX
10-12-2025 Francois Staring How can Researchers and Initial Teacher Educators...
PPTX
How to Manage Line Discounts in Odoo 18 POS
PDF
DHA/HAAD/MOH/DOH OPTOMETRY MCQ PYQ. .pdf
PDF
Current Electricity for first year physiotherapy
PPTX
Searching in PubMed andCochrane_Practical Presentation.pptx
PPTX
How to Manage Reception Report in Odoo 18 Inventory
PPTX
Details of Epithelial and Connective Tissue.pptx
PDF
Projecte de la porta de la classe de primer A: Mar i cel.
PDF
The Tale of Melon City poem ppt by Sahasra
PPTX
Unit I — Introduction to Anatomical Terms and Organization of the Human Body
FAMILY ASSESSMENT FORMAT - CHN practical
Ketogenic diet in Epilepsy in children..
Mobile applications Devlopment ReTest year 2025-2026
How to use search_read method in Odoo 18
The Art Pastor's Guide to the Liturgical Calendar
Rectal Surgery in Senior Citiizens .pptx
Pig- piggy bank in Big Data Analytics.ppt.pptx
The Pity of War: Form, Fragment, and the Artificial Echo | Understanding War ...
Vitamins and mineral deficiency , signs and symptoms associated with exercise
Models of Teaching - TNTEU - B.Ed I Semester - Teaching and Learning - BD1TL ...
10-12-2025 Francois Staring How can Researchers and Initial Teacher Educators...
How to Manage Line Discounts in Odoo 18 POS
DHA/HAAD/MOH/DOH OPTOMETRY MCQ PYQ. .pdf
Current Electricity for first year physiotherapy
Searching in PubMed andCochrane_Practical Presentation.pptx
How to Manage Reception Report in Odoo 18 Inventory
Details of Epithelial and Connective Tissue.pptx
Projecte de la porta de la classe de primer A: Mar i cel.
The Tale of Melon City poem ppt by Sahasra
Unit I — Introduction to Anatomical Terms and Organization of the Human Body

Get started python programming part 1

  • 1.
    Python - Part1Getting started with PythonTradeyathra - Stock market training and forecasting expertsNicholas I
  • 2.
    AgendaIntroductionBasicsStringsControl StructuresList, Tuple,DictionaryFunctionsI/O, Exception HandlingRegular ExpressionsModulesObject Oriented Programming
  • 3.
    Program & ProgrammingWhatis Python?Where It’s Used?InstallationPracticeIntroductionModule 1
  • 4.
    A Program isa set of instructions that a computer follows to perform a particulartask.ProgramStep 1Plug the TV wire tothe electric switchboard.Step 2Turn your Tv on.Step 3Press the powerbutton on your TVremote.Step 4Switch between thechannels by directlyentering the numbersfrom your remote.How to turn on a tv with remote
  • 5.
    Programming is theprocess of writing your ideas into a program using a computerlanguage to perform a task.ProgrammingProgramming languages
  • 6.
    ● It wascreated in 1991 by Guido van Rossum.● Python is an interpreted, interactive, object-oriented programming language.● Python is a high-level general-purpose programming language that can beapplied to many different classes of problems.● Python is portable: it runs on many Unix variants, on the Mac, and on Windows2000 and later● Easy to learn and understand.● Simple syntax and Flexible.What is Python?
  • 7.
    Where it isused?Web and InternetDevelopmentScientific & Numeric Games Desktop GUISoftwareDevelopmentBusinessApplicationsCloud & Data CenterIoT, MachineLearning & AI
  • 8.
    InstallationWindows● https://www.python.org/ftp/python/3.6.6/python-3.6.6rc1-webinstall.exe● Followthe wizard and finish the installation.● Setup the environment variables.Mac and Linux● Mac and Linux comes with python preinstalled.
  • 9.
  • 10.
  • 11.
    Interactive & ScriptModeCommentsNumbersVariablesConstantsInput and OutputBasicsModule 2
  • 12.
    Interactive & ScriptModeScript ModeInteractive
  • 13.
    Comments# Single LineComment# multi# line# Comment""”Docstring is short for documentation string.It is a string that occurs as the first statement in a module, function, class, or method definition.We must write what a function/class does in the docstring."""
  • 14.
    Numbersaddition >>> 8+ 513subtraction >>> 8 - 53multiplication >>> 8 * 513division >>> 8 / 513exponent >>> 4 ** 364negation >>> -2 + -4-6
  • 15.
    Integer and Floatint>>> 3535>>>float >>> 30.530.5An int is a whole number A float is a decimal number
  • 16.
    Order of Operations>>>( 5 + 7 ) * 3 >>> 5 + 7 * 336 26PEMDAS: Parentheses Exponent Multiplication Division Addition Subtraction>>> 12 * 3 >>> 5 + 21
  • 17.
    Variables>>> apples_in_box =105Variable is the container that stores some value.>>> apples_sold = 5>>> apples_balance = apples_in_box - apples_sold510>>> fruit_box = 100variable name Value to be stored
  • 18.
    Naming VariablesName yourvariables meaningful and As long as you’re not breaking these rules,you can name variables anything you want.no spaces = 0 X No spaces in the name3eggs, $price X No digits or special characters in front
  • 19.
    ConstantsConstants are usedto store a value that can be used later in your program. Thevalue of the constant remains same and they do not change.>>> PI = 3.14constant name Value to store>>> GRAVITY = 9.8
  • 20.
    Input and Output>>>input([prompt])Function to acceptvalue from usersvia cliValue to beentered by user>>> print([output])Function to outputvalue to usersValue printed onthe user screen
  • 21.
    String DelimitersConcatenationTriple quotedstring literalsEscape CodesString MethodsStringsModule 3
  • 22.
    StringsA string inPython is a sequence of characters. For Python to recognize asequence of characters, like hello, as a string, it must be enclosed in quotes todelimit the string.>>> "Hello"Note:A string can have any number of characters in it, including 0. The empty string is '' (two quote characters with nothingbetween them). Many beginners forget that having no characters is legal. It can be useful.>>> 'Hello'
  • 23.
    ConcatenationThe plus operationwith strings means concatenate the strings. Python looks atthe type of operands before deciding what operation is associated with the +.>>> "Firstname" + "lastname" >>> 'Hello'Firstnamelastname>>> 3 * 'Smart' + 'Phone'SmartSmartSmartPhone>>> 7 + "star"?
  • 24.
    Note:The line structureis preserved in a multi-line string. As you can see, this also allows you to embedboth single and double quote characters!Triple Quoted String LiteralsStrings delimited by one quote character are required to be within a single line.For example: ‘hello’.It is sometimes convenient to have a multi-line string, whichcan be delimited with triple quotes, '''.
  • 25.
    Note:The line structureis preserved in a multi-line string. As you can see, this also allows you to embedboth single and double quote characters!Escape CodesEscape codes are embedded inside string literals and start with a backslashcharacter . They are used to embed characters that are either unprintable orhave a special syntactic meaning to Python that you want to suppress.
  • 26.
    String MethodsPython hasquite a few methods that string objects can call to perform frequencyoccurring task (related to string). For example, if you want to capitalize the firstletter of a string, you can use capitalize() methodcapitalize() Converts first character to capital lettercount() Counts the occurrences of a substringupper() Returns uppercased stringlower() Returns lowercased stringlen() Returns length of a stringsplit() Separates the words in sentences.
  • 27.
  • 28.
    if , elifand elsewhileforbreakControlStructuresModule 4
  • 29.
    if, elif &elseif condition:statementselse:statementif condition:statementselif condition:statementselse:statementsa = 0if a == 0:print('A is equal to 0')else:print('A is not equal to 0')a = 2if a == 0:print('A is equal to 0')elif a == 1:print('A is equal to 1')else:print('A is not equal to 0 or 1')Theif…elif…elsestatement isused fordecisionmaking.Syntax SyntaxRun Run
  • 30.
    Loginuname = 'admin'pword= 'admin'# user to enter their usernname & passwordusernname = input('username: ')password = input('password: ')if usernname == uname and password == pword:print('Login successful')else:print('Sorry! Invalid username and password')
  • 31.
    whileRun the statementsuntil a given condition is true.while condition:statementSyntaxmovie = 'Spider Man'while movie == 'Spider Man':print('Yes! I am Spider Man')breakRun
  • 32.
    forLoops through elementsin sequence & store in a variablethat can be used later in the program.for variable in sequence:statementSyntax
  • 33.
    for# print 0-9numbers using for loopfor number in range(10):print(number)Run# print all the elements in fruits listfruits = ['apple','banana','orange']for fruit in fruits:print(fruit)Run
  • 34.
    for - nestedcountries= ['India','US','China','Europe']fruits = ['apple','banana','orange']for country in countries:for fruit in fruits:print(country,':', fruit)print('-----------------')Run
  • 35.
    breaka = 0whilea==0:print('hello')Runa = 0while a==0:print('hello')breakRun
  • 36.
    Nicholas ITradeyathranicholas.domnic.i@gmail.comCall /Whatsapp : 8050012644Telegram: t.me/tradeyathraThank You

[8]ページ先頭

©2009-2025 Movatter.jp