SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
Python - Part 1
Getting started with Python
Tradeyathra - Stock market training and forecasting experts
Nicholas I
Agenda
Introduction
Basics
Strings
Control Structures
List, Tuple, Dictionary
Functions
I/O, Exception Handling
Regular Expressions
Modules
Object Oriented Programming
Program & Programming
What is Python?
Where It’s Used?
Installation
Practice
Introduction
Module 1
A Program is a set of instructions that a computer follows to perform a particular
task.
Program
Step 1
Plug the TV wire to
the electric switch
board.
Step 2
Turn your Tv on.
Step 3
Press the power
button on your TV
remote.
Step 4
Switch between the
channels by directly
entering the numbers
from your remote.
How to turn on a tv with remote
Programming is the process of writing your ideas into a program using a computer
language to perform a task.
Programming
Programming 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 be
applied to many diïŹ€erent classes of problems.
● Python is portable: it runs on many Unix variants, on the Mac, and on Windows
2000 and later
● Easy to learn and understand.
● Simple syntax and Flexible.
What is Python?
Where it is used?
Web and Internet
Development
ScientiïŹc & Numeric Games Desktop GUI
Software
Development
Business
Applications
Cloud & Data Center
IoT, Machine
Learning & AI
Installation
Windows
● https://www.python.org/ftp/python/3.6.6/python-3.6.6rc1-webinstall.exe
● Follow the wizard and ïŹnish the installation.
● Setup the environment variables.
Mac and Linux
● Mac and Linux comes with python preinstalled.
Practice
Time to set-up
python on your system...
Questions & Answers
Interactive & Script Mode
Comments
Numbers
Variables
Constants
Input and Output
Basics
Module 2
Interactive & Script Mode
Script Mode
Interactive
Comments
# Single Line Comment
# multi
# line
# Comment
""”
Docstring is short for documentation string.
It is a string that occurs as the ïŹrst statement in a module, function, class, or method deïŹnition.
We must write what a function/class does in the docstring.
"""
Numbers
addition >>> 8 + 5
13
subtraction >>> 8 - 5
3
multiplication >>> 8 * 5
13
division >>> 8 / 5
13
exponent >>> 4 ** 3
64
negation >>> -2 + -4
-6
Integer and Float
int >>> 35
35
>>>float >>> 30.5
30.5
An int is a whole number A float is a decimal number
Order of Operations
>>> ( 5 + 7 ) * 3 >>> 5 + 7 * 3
36 26
PEMDAS: Parentheses Exponent Multiplication Division Addition Subtraction
>>> 12 * 3 >>> 5 + 21
Variables
>>> apples_in_box = 10
5
Variable is the container that stores some value.
>>> apples_sold = 5
>>> apples_balance = apples_in_box - apples_sold
5
10
>>> fruit_box = 100
variable name Value to be stored
Naming Variables
Name 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 name
3eggs, $price X No digits or special characters in front
Constants
Constants are used to store a value that can be used later in your program. The
value of the constant remains same and they do not change.
>>> PI = 3.14
constant name Value to store
>>> GRAVITY = 9.8
Input and Output
>>> input([prompt])
Function to accept
value from users
via cli
Value to be
entered by user
>>> print([output])
Function to output
value to users
Value printed on
the user screen
String Delimiters
Concatenation
Triple quoted string literals
Escape Codes
String Methods
Strings
Module 3
Strings
A string in Python is a sequence of characters. For Python to recognize a
sequence of characters, like hello, as a string, it must be enclosed in quotes to
delimit the string.
>>> "Hello"
Note:
A string can have any number of characters in it, including 0. The empty string is '' (two quote characters with nothing
between them). Many beginners forget that having no characters is legal. It can be useful.
>>> 'Hello'
Concatenation
The plus operation with strings means concatenate the strings. Python looks at
the 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 embed
both single and double quote characters!
Triple Quoted String Literals
Strings 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, which
can 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 embed
both single and double quote characters!
Escape Codes
Escape codes are embedded inside string literals and start with a backslash
character . They are used to embed characters that are either unprintable or
have a special syntactic meaning to Python that you want to suppress.
String Methods
Python has quite a few methods that string objects can call to perform frequency
occurring task (related to string). For example, if you want to capitalize the ïŹrst
letter of a string, you can use capitalize() method
capitalize() Converts first character to capital letter
count() Counts the occurrences of a substring
upper() Returns uppercased string
lower() Returns lowercased string
len() Returns length of a string
split() Separates the words in sentences.
split()
if , elif and else
while
for
break
Control
Structures
Module 4
if, elif & else
if condition:
statements
else:
statement
if condition:
statements
elif condition:
statements
else:
statements
a = 0
if a == 0:
print('A is equal to 0')
else:
print('A is not equal to 0')
a = 2
if 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')
The
if
elif
else
statement is
used for
decision
making.
Syntax Syntax
Run Run
Login
uname = 'admin'
pword = 'admin'
# user to enter their usernname & password
usernname = input('username: ')
password = input('password: ')
if usernname == uname and password == pword:
print('Login successful')
else:
print('Sorry! Invalid username and password')
while
Run the statements until a given condition is true.
while condition:
statement
Syntax
movie = 'Spider Man'
while movie == 'Spider Man':
print('Yes! I am Spider Man')
break
Run
for
Loops through elements in sequence & store in a variable
that can be used later in the program.
for variable in sequence:
statement
Syntax
for
# print 0-9 numbers using for loop
for number in range(10):
print(number)
Run
# print all the elements in fruits list
fruits = ['apple','banana','orange']
for fruit in fruits:
print(fruit)
Run
for - nested
countries = ['India','US','China','Europe']
fruits = ['apple','banana','orange']
for country in countries:
for fruit in fruits:
print(country,':', fruit)
print('-----------------')
Run
break
a = 0
while a==0:
print('hello')
Run
a = 0
while a==0:
print('hello')
break
Run
Nicholas I
Tradeyathra
nicholas.domnic.i@gmail.com
Call / Whatsapp : 8050012644
Telegram: t.me/tradeyathra
Thank You

Weitere Àhnliche Inhalte

Was ist angesagt?

Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Paige Bailey
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonAyshwarya Baburam
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Edureka!
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Pedro Rodrigues
 
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...Edureka!
 
Python, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for EngineersPython, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for EngineersBoey Pak Cheong
 
Overview of python 2019
Overview of python 2019Overview of python 2019
Overview of python 2019Samir Mohanty
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming pptismailmrribi
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To PythonVanessa Rene
 
Basic Concepts in Python
Basic Concepts in PythonBasic Concepts in Python
Basic Concepts in PythonSumit Satam
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on pythonwilliam john
 
Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Fariz Darari
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An IntroductionSwarit Wadhe
 
Python Tutorial for Beginner
Python Tutorial for BeginnerPython Tutorial for Beginner
Python Tutorial for Beginnerrajkamaltibacademy
 
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming LanguageR.h. Himel
 

Was ist angesagt? (20)

Python - the basics
Python - the basicsPython - the basics
Python - the basics
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
 
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
 
Python, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for EngineersPython, the Language of Science and Engineering for Engineers
Python, the Language of Science and Engineering for Engineers
 
Overview of python 2019
Overview of python 2019Overview of python 2019
Overview of python 2019
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To Python
 
Basic Concepts in Python
Basic Concepts in PythonBasic Concepts in Python
Basic Concepts in Python
 
Python programming
Python  programmingPython  programming
Python programming
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on python
 
Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
 
Python Basics
Python BasicsPython Basics
Python Basics
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
 
Python Tutorial for Beginner
Python Tutorial for BeginnerPython Tutorial for Beginner
Python Tutorial for Beginner
 
Python ppt
Python pptPython ppt
Python ppt
 
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming Language
 

Ähnlich wie Get started python programming part 1

01-Python-Basics.ppt
01-Python-Basics.ppt01-Python-Basics.ppt
01-Python-Basics.pptVicVic56
 
Basic of Python- Hands on Session
Basic of Python- Hands on SessionBasic of Python- Hands on Session
Basic of Python- Hands on SessionDharmesh Tank
 
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...DRVaibhavmeshram1
 
Notes1
Notes1Notes1
Notes1hccit
 
Intro to Python Programming Language
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming LanguageDipankar Achinta
 
Python Tutorial
Python TutorialPython Tutorial
Python TutorialAkramWaseem
 
An overview on python commands for solving the problems
An overview on python commands for solving the problemsAn overview on python commands for solving the problems
An overview on python commands for solving the problemsRavikiran708913
 
Improve Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptxImprove Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptxCatherineVania1
 
Python Essentials - PICT.pdf
Python Essentials - PICT.pdfPython Essentials - PICT.pdf
Python Essentials - PICT.pdfPrashant Jamkhande
 
introduction to python in english presentation file
introduction to python in english presentation fileintroduction to python in english presentation file
introduction to python in english presentation fileRujanTimsina1
 
FUNDAMENTALS OF PYTHON LANGUAGE
 FUNDAMENTALS OF PYTHON LANGUAGE  FUNDAMENTALS OF PYTHON LANGUAGE
FUNDAMENTALS OF PYTHON LANGUAGE Saraswathi Murugan
 
Python Basics by Akanksha Bali
Python Basics by Akanksha BaliPython Basics by Akanksha Bali
Python Basics by Akanksha BaliAkanksha Bali
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentalsnatnaelmamuye
 
FALLSEM2022-23_ITA3007_ETH_VL2022230100613_Reference_Material_I_23-09-2022_py...
FALLSEM2022-23_ITA3007_ETH_VL2022230100613_Reference_Material_I_23-09-2022_py...FALLSEM2022-23_ITA3007_ETH_VL2022230100613_Reference_Material_I_23-09-2022_py...
FALLSEM2022-23_ITA3007_ETH_VL2022230100613_Reference_Material_I_23-09-2022_py...admin369652
 

Ähnlich wie Get started python programming part 1 (20)

01-Python-Basics.ppt
01-Python-Basics.ppt01-Python-Basics.ppt
01-Python-Basics.ppt
 
Basic of Python- Hands on Session
Basic of Python- Hands on SessionBasic of Python- Hands on Session
Basic of Python- Hands on Session
 
lecture 2.pptx
lecture 2.pptxlecture 2.pptx
lecture 2.pptx
 
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
 
Notes1
Notes1Notes1
Notes1
 
Intro to Python Programming Language
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming Language
 
Python Tutorial
Python TutorialPython Tutorial
Python Tutorial
 
Python tutorial
Python tutorialPython tutorial
Python tutorial
 
An overview on python commands for solving the problems
An overview on python commands for solving the problemsAn overview on python commands for solving the problems
An overview on python commands for solving the problems
 
Improve Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptxImprove Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptx
 
Python Essentials - PICT.pdf
Python Essentials - PICT.pdfPython Essentials - PICT.pdf
Python Essentials - PICT.pdf
 
Python basics
Python basicsPython basics
Python basics
 
introduction to python in english presentation file
introduction to python in english presentation fileintroduction to python in english presentation file
introduction to python in english presentation file
 
Pythonppt28 11-18
Pythonppt28 11-18Pythonppt28 11-18
Pythonppt28 11-18
 
FUNDAMENTALS OF PYTHON LANGUAGE
 FUNDAMENTALS OF PYTHON LANGUAGE  FUNDAMENTALS OF PYTHON LANGUAGE
FUNDAMENTALS OF PYTHON LANGUAGE
 
Python Basics by Akanksha Bali
Python Basics by Akanksha BaliPython Basics by Akanksha Bali
Python Basics by Akanksha Bali
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentals
 
FALLSEM2022-23_ITA3007_ETH_VL2022230100613_Reference_Material_I_23-09-2022_py...
FALLSEM2022-23_ITA3007_ETH_VL2022230100613_Reference_Material_I_23-09-2022_py...FALLSEM2022-23_ITA3007_ETH_VL2022230100613_Reference_Material_I_23-09-2022_py...
FALLSEM2022-23_ITA3007_ETH_VL2022230100613_Reference_Material_I_23-09-2022_py...
 
Python 3.pptx
Python 3.pptxPython 3.pptx
Python 3.pptx
 
Python for Beginners(v1)
Python for Beginners(v1)Python for Beginners(v1)
Python for Beginners(v1)
 

KĂŒrzlich hochgeladen

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 

KĂŒrzlich hochgeladen (20)

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
CĂłdigo Creativo y Arte de Software | Unidad 1
CĂłdigo Creativo y Arte de Software | Unidad 1CĂłdigo Creativo y Arte de Software | Unidad 1
CĂłdigo Creativo y Arte de Software | Unidad 1
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 

Get started python programming part 1

  • 1. Python - Part 1 Getting started with Python Tradeyathra - Stock market training and forecasting experts Nicholas I
  • 2. Agenda Introduction Basics Strings Control Structures List, Tuple, Dictionary Functions I/O, Exception Handling Regular Expressions Modules Object Oriented Programming
  • 3. Program & Programming What is Python? Where It’s Used? Installation Practice Introduction Module 1
  • 4. A Program is a set of instructions that a computer follows to perform a particular task. Program Step 1 Plug the TV wire to the electric switch board. Step 2 Turn your Tv on. Step 3 Press the power button on your TV remote. Step 4 Switch between the channels by directly entering the numbers from your remote. How to turn on a tv with remote
  • 5. Programming is the process of writing your ideas into a program using a computer language to perform a task. Programming Programming languages
  • 6. ● 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 be applied to many diïŹ€erent classes of problems. ● Python is portable: it runs on many Unix variants, on the Mac, and on Windows 2000 and later ● Easy to learn and understand. ● Simple syntax and Flexible. What is Python?
  • 7. Where it is used? Web and Internet Development ScientiïŹc & Numeric Games Desktop GUI Software Development Business Applications Cloud & Data Center IoT, Machine Learning & AI
  • 8. Installation Windows ● https://www.python.org/ftp/python/3.6.6/python-3.6.6rc1-webinstall.exe ● Follow the wizard and ïŹnish the installation. ● Setup the environment variables. Mac and Linux ● Mac and Linux comes with python preinstalled.
  • 9. Practice Time to set-up python on your system...
  • 11. Interactive & Script Mode Comments Numbers Variables Constants Input and Output Basics Module 2
  • 12. Interactive & Script Mode Script Mode Interactive
  • 13. Comments # Single Line Comment # multi # line # Comment ""” Docstring is short for documentation string. It is a string that occurs as the ïŹrst statement in a module, function, class, or method deïŹnition. We must write what a function/class does in the docstring. """
  • 14. Numbers addition >>> 8 + 5 13 subtraction >>> 8 - 5 3 multiplication >>> 8 * 5 13 division >>> 8 / 5 13 exponent >>> 4 ** 3 64 negation >>> -2 + -4 -6
  • 15. Integer and Float int >>> 35 35 >>>float >>> 30.5 30.5 An int is a whole number A float is a decimal number
  • 16. Order of Operations >>> ( 5 + 7 ) * 3 >>> 5 + 7 * 3 36 26 PEMDAS: Parentheses Exponent Multiplication Division Addition Subtraction >>> 12 * 3 >>> 5 + 21
  • 17. Variables >>> apples_in_box = 10 5 Variable is the container that stores some value. >>> apples_sold = 5 >>> apples_balance = apples_in_box - apples_sold 5 10 >>> fruit_box = 100 variable name Value to be stored
  • 18. Naming Variables Name 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 name 3eggs, $price X No digits or special characters in front
  • 19. Constants Constants are used to store a value that can be used later in your program. The value of the constant remains same and they do not change. >>> PI = 3.14 constant name Value to store >>> GRAVITY = 9.8
  • 20. Input and Output >>> input([prompt]) Function to accept value from users via cli Value to be entered by user >>> print([output]) Function to output value to users Value printed on the user screen
  • 21. String Delimiters Concatenation Triple quoted string literals Escape Codes String Methods Strings Module 3
  • 22. Strings A string in Python is a sequence of characters. For Python to recognize a sequence of characters, like hello, as a string, it must be enclosed in quotes to delimit the string. >>> "Hello" Note: A string can have any number of characters in it, including 0. The empty string is '' (two quote characters with nothing between them). Many beginners forget that having no characters is legal. It can be useful. >>> 'Hello'
  • 23. Concatenation The plus operation with strings means concatenate the strings. Python looks at the 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 structure is preserved in a multi-line string. As you can see, this also allows you to embed both single and double quote characters! Triple Quoted String Literals Strings 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, which can be delimited with triple quotes, '''.
  • 25. Note: The line structure is preserved in a multi-line string. As you can see, this also allows you to embed both single and double quote characters! Escape Codes Escape codes are embedded inside string literals and start with a backslash character . They are used to embed characters that are either unprintable or have a special syntactic meaning to Python that you want to suppress.
  • 26. String Methods Python has quite a few methods that string objects can call to perform frequency occurring task (related to string). For example, if you want to capitalize the ïŹrst letter of a string, you can use capitalize() method capitalize() Converts first character to capital letter count() Counts the occurrences of a substring upper() Returns uppercased string lower() Returns lowercased string len() Returns length of a string split() Separates the words in sentences.
  • 28. if , elif and else while for break Control Structures Module 4
  • 29. if, elif & else if condition: statements else: statement if condition: statements elif condition: statements else: statements a = 0 if a == 0: print('A is equal to 0') else: print('A is not equal to 0') a = 2 if 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') The if
elif
else statement is used for decision making. Syntax Syntax Run Run
  • 30. Login uname = 'admin' pword = 'admin' # user to enter their usernname & password usernname = input('username: ') password = input('password: ') if usernname == uname and password == pword: print('Login successful') else: print('Sorry! Invalid username and password')
  • 31. while Run the statements until a given condition is true. while condition: statement Syntax movie = 'Spider Man' while movie == 'Spider Man': print('Yes! I am Spider Man') break Run
  • 32. for Loops through elements in sequence & store in a variable that can be used later in the program. for variable in sequence: statement Syntax
  • 33. for # print 0-9 numbers using for loop for number in range(10): print(number) Run # print all the elements in fruits list fruits = ['apple','banana','orange'] for fruit in fruits: print(fruit) Run
  • 34. for - nested countries = ['India','US','China','Europe'] fruits = ['apple','banana','orange'] for country in countries: for fruit in fruits: print(country,':', fruit) print('-----------------') Run
  • 35. break a = 0 while a==0: print('hello') Run a = 0 while a==0: print('hello') break Run
  • 36. Nicholas I Tradeyathra nicholas.domnic.i@gmail.com Call / Whatsapp : 8050012644 Telegram: t.me/tradeyathra Thank You