SlideShare a Scribd company logo
Introduction to PythonIntroduction to Python
ProgrammingProgramming
Why Python?Why Python?
 Python is what is referred to as an object-oriented programming
language (OOP)
 Python is a general purpose programming language. That means you
can use Python to write code for a number of programming tasks.
◦ Google search engine
◦ Gaming
◦ Processing financial
transactions
◦ Data Analytics
◦ Physical Programming
 Simple
 Less Syntax
 Extensive User Community
 Interpreted
Interpreted?Interpreted?
Python is interpreted, which means that
python code is translated and executed by
an interpreter one statement at a time.
This means you can run commands/code
on the command prompt…
Through a command
prompt with a text file…
Using an IDE
What Does It Look Like?What Does It Look Like?
Parts of a Python ProgramParts of a Python Program
Def: Source Code is the program text
entered into an interpreter by the
programmer.
◦ The saved file is referred to as, the source file.
◦ The main file in a python program, called main
◦ Can program on the command prompt
The extension to a python source file is “.py”
◦ Xcel - .xls
◦ Power Point - .ppt
Two main parts to a source file
◦ Modules
◦ Main code
Good programming proclamationsGood programming proclamations
Using comments to denote programs or
sections of code
◦ A comment beginning with # is called a single-line comment
because it terminates at the end of the current line.
◦ You also may use a multi-line comment—possibly containing
many lines—begins with ’’’ and ends with ’’’.
You use blank lines, space characters and tab characters
(i.e., “tabs”) to make programs easier to read.
◦ Together, these characters are known as white space.
◦ White-space characters are USUALLY ignored by the interpreter.
◦ Python has its own rules with white space
ModulesModules
 A module is a python source file that has prewritten
python code.
 These predefined files allow users to utilize code that has
been previously developed.
◦ Don’t have to recreate the wheel, just use the wheel and
improve on the technology.
 math
 time
 Gpiozero
 Os
 Code: Importing modules
 import module_name
 from module_name import class_name
ExpressionsExpressions
• A programming expression is a
combination of symbols to represent a
value.
• One side of an equation
• Ex.
• 5+7
• False
• print()
• led.on()
Printing a Line of TextPrinting a Line of Text
print(“ “)
Anything placed inside the quotes will be printed on the screen
upon execution of the print command.
Manipulating TimeManipulating Time
The time module is a popular module which
provides functions for working with times and
converting between them.
◦ sleep
◦ local time
◦ epoch time
Code:
◦ Importing time module
 import time
◦ Using time functions
 time.sleep(#)
 time.localtime(time.time())
Manipulating LED’sManipulating LED’s
 The Raspberry Pi comes with a library RPi.GPIO that allow
the manipulation of GPIO pins: s
◦ Setup pins as inputs or outputs
◦ Read inputs
◦ Set output levels
 However, gpiozero is a wrapper library that is built on top
of RPi.GPIO to provide a simpler interface to manipulate
the pins.
 Code:
◦ Importing gpiozero module
 import gpiozero
◦ Using led functions and objects
 LED(pin#).on()
 LED(pin#).off()
 LED(pin#).blink()
CheckpointCheckpoint
1. What is an IDE?
2. What is a comment and its importance?
3. How is white space used in
programming?
4. What are modules?
5. Name 2 modules

More Related Content

PPT
Intro to Python with GPIO
PPT
Intro to Python
PPT
Introduction to python
PPTX
Python presentation
PPTX
Beginning Python Programming
PPTX
Programming
PPTX
Introduction to python programming, Why Python?, Applications of Python
PPTX
Python | What is Python | History of Python | Python Tutorial
Intro to Python with GPIO
Intro to Python
Introduction to python
Python presentation
Beginning Python Programming
Programming
Introduction to python programming, Why Python?, Applications of Python
Python | What is Python | History of Python | Python Tutorial

What's hot (20)

PPTX
Introduction to Python Basics Programming
PPTX
Python programming introduction
PPTX
Top python interview question and answer
PDF
Python programming
PPTX
Python Tutorial Part 2
PPTX
Introduction to Python Programming
PPTX
Python 101
PDF
Introduction to python programming
PPTX
2018 20 best id es for python programming
PPTX
Introduction to Python Programing
PDF
Python final ppt
PPTX
Python part1
PPT
Smoothing Your Java with DSLs
PPT
Python Introduction
PPTX
Introduction to python
PPTX
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
PDF
Introduction to python
PPT
Python Introduction
PPTX
Python basic
Introduction to Python Basics Programming
Python programming introduction
Top python interview question and answer
Python programming
Python Tutorial Part 2
Introduction to Python Programming
Python 101
Introduction to python programming
2018 20 best id es for python programming
Introduction to Python Programing
Python final ppt
Python part1
Smoothing Your Java with DSLs
Python Introduction
Introduction to python
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Introduction to python
Python Introduction
Python basic
Ad

Similar to Intro to Python (20)

PPTX
Python tutorial for beginners - Tib academy
PPTX
ITC 110 Week 10 Introdution to Python .pptx
PDF
Learning python in a cool and fun way-Module-1.1.pdf
PDF
Introduction to Python Unit -1 Part .pdf
PPTX
Introduction to python for Beginners
PPTX
Introduction python
PPTX
python programminig and introduction.pptx
PDF
ppt notes for python language variable data types
PPTX
Python Tutorial | Python Programming Language
PDF
intro.pptx (1).pdf
PPTX
Python Programming Draft PPT.pptx
PPTX
INTRODUCTION-TO-PYTHON
PPTX
introduction to python in computer graphics.pptx
PDF
Python and Pytorch tutorial and walkthrough
PPTX
Python Basics for first semester Students and everyone
PPTX
Introduction-to-Python-Programming1.pptx
PPTX
Introduction to Python and Basic Syntax.pptx
PPTX
Python programming language introduction unit
PPTX
4_Introduction to Python Programming.pptx
PPTX
637b4894085c4_ppt.pptx
Python tutorial for beginners - Tib academy
ITC 110 Week 10 Introdution to Python .pptx
Learning python in a cool and fun way-Module-1.1.pdf
Introduction to Python Unit -1 Part .pdf
Introduction to python for Beginners
Introduction python
python programminig and introduction.pptx
ppt notes for python language variable data types
Python Tutorial | Python Programming Language
intro.pptx (1).pdf
Python Programming Draft PPT.pptx
INTRODUCTION-TO-PYTHON
introduction to python in computer graphics.pptx
Python and Pytorch tutorial and walkthrough
Python Basics for first semester Students and everyone
Introduction-to-Python-Programming1.pptx
Introduction to Python and Basic Syntax.pptx
Python programming language introduction unit
4_Introduction to Python Programming.pptx
637b4894085c4_ppt.pptx
Ad

More from primeteacher32 (20)

PPT
Software Development Life Cycle
PPTX
Variable Scope
PPTX
Returning Data
PPTX
Intro to Functions
PPTX
Introduction to GUIs with guizero
PPTX
Function Parameters
PPTX
Nested Loops
PPT
Conditional Loops
PPTX
Introduction to Repetition Structures
PPTX
Input Validation
PPTX
Windows File Systems
PPTX
Nesting Conditionals
PPTX
Conditionals
PPTX
Variables and Statements
PPTX
Variables and User Input
PPTX
Raspberry Pi
PPT
Hardware vs. Software Presentations
PPTX
Block chain security
PPTX
PPTX
System Administration
Software Development Life Cycle
Variable Scope
Returning Data
Intro to Functions
Introduction to GUIs with guizero
Function Parameters
Nested Loops
Conditional Loops
Introduction to Repetition Structures
Input Validation
Windows File Systems
Nesting Conditionals
Conditionals
Variables and Statements
Variables and User Input
Raspberry Pi
Hardware vs. Software Presentations
Block chain security
System Administration

Recently uploaded (20)

PPTX
DPT-MAY24.pptx for review and ucploading
PDF
Sheri Ann Lowe Compliance Strategist Resume
PPTX
employee on boarding for jobs for freshers try it
PPTX
_Dispute Resolution_July 2022.pptxmhhghhhh
PDF
Beyond the Lab Coat - Perjalanan Karier di Dunia Pasca-Fisika S1
PDF
CV of Architect Professor A F M Mohiuddin Akhand.pdf
PPTX
CYBER SECURITY PPT.pptx CYBER SECURITY APPLICATION AND USAGE
PPTX
Digital Education Presentation for students.
PPTX
Prokaryotes v Eukaryotes PowerPoint.pptx
PPT
NO000387 (1).pptsbsnsnsnsnsnsnsmsnnsnsnsjsnnsnsnsnnsnnansnwjwnshshshs
PPTX
Principles of Inheritance and variation class 12.pptx
PPTX
AREAS OF SPECIALIZATION AND CAREER OPPORTUNITIES FOR COMMUNICATORS AND JOURNA...
PPTX
The-Scope-of-Food-Quality-and-Safety.pptx managemement
PPT
pwm ppt .pdf long description of pwm....
PPTX
FINAL PPT.pptx cfyufuyfuyuy8ioyoiuvy ituyc utdfm v
PPTX
Core Characteristics and Abilities of an Effective Teacher_0.pptx
PDF
servsafecomprehensive-ppt-full-140617222538-phpapp01.pdf
PPTX
Your Guide to a Winning Interview Aug 2025.
PDF
202s5_Luciano André Deitos Koslowski.pdf
PDF
MCQ Practice CBT OL Official Language 1.pptx.pdf
DPT-MAY24.pptx for review and ucploading
Sheri Ann Lowe Compliance Strategist Resume
employee on boarding for jobs for freshers try it
_Dispute Resolution_July 2022.pptxmhhghhhh
Beyond the Lab Coat - Perjalanan Karier di Dunia Pasca-Fisika S1
CV of Architect Professor A F M Mohiuddin Akhand.pdf
CYBER SECURITY PPT.pptx CYBER SECURITY APPLICATION AND USAGE
Digital Education Presentation for students.
Prokaryotes v Eukaryotes PowerPoint.pptx
NO000387 (1).pptsbsnsnsnsnsnsnsmsnnsnsnsjsnnsnsnsnnsnnansnwjwnshshshs
Principles of Inheritance and variation class 12.pptx
AREAS OF SPECIALIZATION AND CAREER OPPORTUNITIES FOR COMMUNICATORS AND JOURNA...
The-Scope-of-Food-Quality-and-Safety.pptx managemement
pwm ppt .pdf long description of pwm....
FINAL PPT.pptx cfyufuyfuyuy8ioyoiuvy ituyc utdfm v
Core Characteristics and Abilities of an Effective Teacher_0.pptx
servsafecomprehensive-ppt-full-140617222538-phpapp01.pdf
Your Guide to a Winning Interview Aug 2025.
202s5_Luciano André Deitos Koslowski.pdf
MCQ Practice CBT OL Official Language 1.pptx.pdf

Intro to Python

  • 1. Introduction to PythonIntroduction to Python ProgrammingProgramming
  • 2. Why Python?Why Python?  Python is what is referred to as an object-oriented programming language (OOP)  Python is a general purpose programming language. That means you can use Python to write code for a number of programming tasks. ◦ Google search engine ◦ Gaming ◦ Processing financial transactions ◦ Data Analytics ◦ Physical Programming  Simple  Less Syntax  Extensive User Community  Interpreted
  • 3. Interpreted?Interpreted? Python is interpreted, which means that python code is translated and executed by an interpreter one statement at a time. This means you can run commands/code on the command prompt… Through a command prompt with a text file… Using an IDE
  • 4. What Does It Look Like?What Does It Look Like?
  • 5. Parts of a Python ProgramParts of a Python Program Def: Source Code is the program text entered into an interpreter by the programmer. ◦ The saved file is referred to as, the source file. ◦ The main file in a python program, called main ◦ Can program on the command prompt The extension to a python source file is “.py” ◦ Xcel - .xls ◦ Power Point - .ppt Two main parts to a source file ◦ Modules ◦ Main code
  • 6. Good programming proclamationsGood programming proclamations Using comments to denote programs or sections of code ◦ A comment beginning with # is called a single-line comment because it terminates at the end of the current line. ◦ You also may use a multi-line comment—possibly containing many lines—begins with ’’’ and ends with ’’’. You use blank lines, space characters and tab characters (i.e., “tabs”) to make programs easier to read. ◦ Together, these characters are known as white space. ◦ White-space characters are USUALLY ignored by the interpreter. ◦ Python has its own rules with white space
  • 7. ModulesModules  A module is a python source file that has prewritten python code.  These predefined files allow users to utilize code that has been previously developed. ◦ Don’t have to recreate the wheel, just use the wheel and improve on the technology.  math  time  Gpiozero  Os  Code: Importing modules  import module_name  from module_name import class_name
  • 8. ExpressionsExpressions • A programming expression is a combination of symbols to represent a value. • One side of an equation • Ex. • 5+7 • False • print() • led.on()
  • 9. Printing a Line of TextPrinting a Line of Text print(“ “) Anything placed inside the quotes will be printed on the screen upon execution of the print command.
  • 10. Manipulating TimeManipulating Time The time module is a popular module which provides functions for working with times and converting between them. ◦ sleep ◦ local time ◦ epoch time Code: ◦ Importing time module  import time ◦ Using time functions  time.sleep(#)  time.localtime(time.time())
  • 11. Manipulating LED’sManipulating LED’s  The Raspberry Pi comes with a library RPi.GPIO that allow the manipulation of GPIO pins: s ◦ Setup pins as inputs or outputs ◦ Read inputs ◦ Set output levels  However, gpiozero is a wrapper library that is built on top of RPi.GPIO to provide a simpler interface to manipulate the pins.  Code: ◦ Importing gpiozero module  import gpiozero ◦ Using led functions and objects  LED(pin#).on()  LED(pin#).off()  LED(pin#).blink()
  • 12. CheckpointCheckpoint 1. What is an IDE? 2. What is a comment and its importance? 3. How is white space used in programming? 4. What are modules? 5. Name 2 modules

Editor's Notes

  • #5: Common elements in programming languages: Key Words Programmer-Defined Identifiers Operators Punctuation Syntax
  • #9: Where have you heard of expressions before? Math class and what were they