SlideShare a Scribd company logo
1 of 31
Download to read offline
PYTHON WITH RASPBERRY PI
Eng. Elaf Ahmed Saeed
PROGRAMMING LANGUAGES
• The programming languages ​​supported by Raspberry Pi are all
the languages ​​supported by Linux, such as Python, Pascal, Java,
and many other languages. We will use the python language in
this course to program the GPIO control ports for the features
that are available in this language over other languages ​​which we
will list when introducing Python language.
PROGRAMMING LANGUAGES
PYTHON
PYTHON
• Python is one of the languages High-level and advanced programming.
This language is characterized by its simplicity in writing and
reading, easy to learn and open source which made it scalable.
• Python can be used for various stages of programming from Through
programming simple programs for beginners and reaching the
completion of huge projects like any other programming language.
PYTHON
• Why did we choose Python to program Control ports?
Because of the advantages that this language has over other
languages. Perhaps the most important characteristic of it is
the ease of learning this language and it is a free and open
source language.
PYTHON
• Python Characteristics
o Open source: You can freely read and edit the source code In which.
o Easy to learn: due to the simplicity of writing and reading this language.
o Practical: Works on all operating systems and their different versions
o Code Libraries: There are a large number of software libraries available Supported by this
language.
o Support: Supported by the programming community in the World Wide Web Significantly.
o GPIO: Supports programming of control ports on the Raspberry Pi
PYTHON
PYTHON
• Methods for working on the Python interpreter:
1. Python interpreter
PYTHON
• Methods for working on the Python interpreter:
2. Command line: by typing The next command on the
command line  Python
PYTHON
• Methods for working on the Python interpreter:
3. A text file with the extension
(py).
BASIC PYTHON OPERATIONS
• printing
• print "text"
• Example 1:
Print “Hello Raspberry pi”
BASIC PYTHON OPERATIONS
• Writing (print)
• print ‘ “ text ” ’
• Example 2:
print 'Hello "Raspberry" Pi’
BASIC PYTHON OPERATIONS
• Comments
• And to make a specific comment in your program what
you need Except tick the box (#) followed by the
comment you want.
• Example:
# Show the following text on screen
print "Hello Raspberry Pi
BASIC PYTHON OPERATIONS
• Comments
• It is possible to benefit from the process of ignoring the translator
For comments invalidate a specific line of code.
• Example
# Show the following text
# on screen
print "Hello"
# print "HelloWorld"
print "Raspberry Pi"
BASIC PYTHON OPERATIONS
• Calculations
• Python has the advantage of its ability to do operations
Arithmetic such as: addition, subtraction, multiplication, and
division Without prior definition of variables. Can do So with
the following command.
Number*Number
• Example: 5*5
BASIC PYTHON OPERATIONS
• Calculations
• It is also possible to link between the printing process and the
calculations, for example
Number*Number
• Example: print "The result of addition 5+5 is ", 10
BASIC PYTHON OPERATIONS
• Variables
• The variables are defined by typing the variable name Followed
by its value between the sign equals and this is done through
the following command:
Var=Value
• Example 1:x=5
BASIC PYTHON OPERATIONS
• Variables
• Example 2:
Raspberry = 50
pi = 50
print " Raspberry + Pi =" , Raspberry + pi
print "Raspberry - Pi =", Raspberry - pi
BASIC PYTHON OPERATIONS
• Variable type
• To find out the type of the variable we write the word type followed
byWith the variable in parentheses
Type(Var_Name)
• Example:
type(x)
BASIC PYTHON OPERATIONS
• if statement
if expression :
Statement(s)
Example:
pi=50
raspberry =50
if pi == raspberry:
print "Hello Raspberry
BASIC PYTHON OPERATIONS
• if-else (if-else statement)
if expression :
Statement(s)
else:
Statement(s)
BASIC PYTHON OPERATIONS
• if-else (if-else statement)
Example:
pi=60
raspberry =60
if pi == raspberry:
print "Hello Raspberry pi"
else:
print "Hello"
BASIC PYTHON OPERATIONS
• while loop
while expression :
Statement(s)
BASIC PYTHON OPERATIONS
• while loop
Example:
count=1
while (count<10) :
print "The number of letters of raspberry" , count
count= count + 1
BASIC PYTHON OPERATIONS
• List
• It is a list that contains a number of values, The value is
specified with a quotation mark and between Each value is
a comma and all values are in between Square brackets
BASIC PYTHON OPERATIONS
• List
list_Num=[ 1 , 2 , 3 , 4 , 5 ]
list_Lett=[ "R", "a", "s","p", "b", "e","r","r","y"]
list_Mix=[1, 2 , "a", "b"]
BASIC PYTHON OPERATIONS
• List
• Example:
list_Num=[ 1 , 2 , 3 , 4 , 5 ]
list_Lett=[ "R", "a", "s", "p","b", "e","r","r","y"]
list_Mix=[1,2 , "a", "b"]
print " List_Num in position 2 is ", list_Num[2]
print " list_Lett in position 0 is ", list_Lett [0]
print " list_Mix in position 3 is ", list_Mix [3]
BASIC PYTHON OPERATIONS
• for loop
for iterating_var in sequence:
Statement(s)
• Example:
list_Num=[ 1 , 2 , 3 , 4 , 5 ]
list_Lett=[ "R", "a", "s", "p", "b", "e","r","r","y"]
list_Mix=[1,2 , "a", "b"]
print " List_Num in position 2 is ", list_Num[2]
print " list_Lett in position 0 is ", list_Lett [0]
print " list_Mix in position 3 is ", list_Mix [3]
BASIC PYTHON OPERATIONS
• for loop
• Example:
List_Lett=[ "R", "a", "s", "p", "b", "e","r","r","y"]
for letter in list_ Lett:
print "letters of raspberry pi", letter
Eng. Elaf Ahmed Saeed
• Email: elafe1888@gmail.com
• linkden: www.linkedin.com/in/elaf-a-saeed-97bbb6150
• facebook: https://www.facebook.com/profile.php?id=100004305557442
• github: https://github.com/ElafAhmedSaeed
• youtube: https://youtube.com/channel/UCE_RiXkyqREUdLAiZcbBqSg
• slideshare: https://www.slideshare.net/ElafASaeed
• Slideplayer: https://slideplayer.com/slide/18029243/
• Google Scholar:
https://scholar.google.com/citations?user=VIpVZKkAAAAJ&hl=ar&gmla=AJsN-
F7PIgAjWJ44Hzb18fwPqJaaUmG0XzbLdzx09

More Related Content

Similar to Pyton with rasperry pi

Python Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxPython Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docx
Manohar k
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
cigogag569
 
Python Programming-1.pptx of python by computer
Python Programming-1.pptx of python by computerPython Programming-1.pptx of python by computer
Python Programming-1.pptx of python by computer
sharanyarashmir5
 

Similar to Pyton with rasperry pi (20)

PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptx
 
Beginning python programming
Beginning python programmingBeginning python programming
Beginning python programming
 
Learning Python for Raspberry Pi
Learning Python for Raspberry PiLearning Python for Raspberry Pi
Learning Python for Raspberry Pi
 
Govind.ppt.pptx
Govind.ppt.pptxGovind.ppt.pptx
Govind.ppt.pptx
 
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
 
Pyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdfPyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdf
 
Python Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxPython Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docx
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Input, Processing and Output
Input, Processing and OutputInput, Processing and Output
Input, Processing and Output
 
Lecture01 - Fundamental Programming with Python Language
Lecture01 - Fundamental Programming with Python LanguageLecture01 - Fundamental Programming with Python Language
Lecture01 - Fundamental Programming with Python Language
 
Python PPT1.pdf
Python PPT1.pdfPython PPT1.pdf
Python PPT1.pdf
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
 
Web Programming UNIT VIII notes
Web Programming UNIT VIII notesWeb Programming UNIT VIII notes
Web Programming UNIT VIII notes
 
Python Programming-1.pptx of python by computer
Python Programming-1.pptx of python by computerPython Programming-1.pptx of python by computer
Python Programming-1.pptx of python by computer
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
python-handbook.pdf
python-handbook.pdfpython-handbook.pdf
python-handbook.pdf
 
if statements in Python -A lecture class
if statements in Python -A lecture classif statements in Python -A lecture class
if statements in Python -A lecture class
 
Laravel level 0 (introduction)
Laravel level 0 (introduction)Laravel level 0 (introduction)
Laravel level 0 (introduction)
 
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdfpython-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
 

More from Elaf A.Saeed

More from Elaf A.Saeed (20)

IOT NodeMCU - NodeMCU Webserver
IOT NodeMCU - NodeMCU WebserverIOT NodeMCU - NodeMCU Webserver
IOT NodeMCU - NodeMCU Webserver
 
IOT NodeMCU - Ubidots Platform to Turn on LEDs
IOT NodeMCU - Ubidots Platform to Turn on LEDsIOT NodeMCU - Ubidots Platform to Turn on LEDs
IOT NodeMCU - Ubidots Platform to Turn on LEDs
 
IOT NodeMCU - Thinger Platform to Turn on LEDs
IOT NodeMCU - Thinger Platform to Turn on LEDsIOT NodeMCU - Thinger Platform to Turn on LEDs
IOT NodeMCU - Thinger Platform to Turn on LEDs
 
IOT NodeMCU - IFTTT Templet to send SMS
IOT NodeMCU - IFTTT Templet to send SMSIOT NodeMCU - IFTTT Templet to send SMS
IOT NodeMCU - IFTTT Templet to send SMS
 
Getting date and time from ntp server with esp8266 node mcu
Getting date and time from ntp server with esp8266 node mcuGetting date and time from ntp server with esp8266 node mcu
Getting date and time from ntp server with esp8266 node mcu
 
ESP8266 NodeMCU Server, Client, Station Mode, and Client Control LED
ESP8266 NodeMCU Server, Client, Station Mode, and Client Control LEDESP8266 NodeMCU Server, Client, Station Mode, and Client Control LED
ESP8266 NodeMCU Server, Client, Station Mode, and Client Control LED
 
IOT NodeMCU - NodeMCU Connection to Internet
IOT NodeMCU - NodeMCU Connection to InternetIOT NodeMCU - NodeMCU Connection to Internet
IOT NodeMCU - NodeMCU Connection to Internet
 
Lesson 10- NodeMCU with LCD I2C
Lesson 10- NodeMCU with LCD I2CLesson 10- NodeMCU with LCD I2C
Lesson 10- NodeMCU with LCD I2C
 
Lesson 9- NodeMCU with Arduino UNO (UART)
Lesson 9- NodeMCU with Arduino UNO (UART)Lesson 9- NodeMCU with Arduino UNO (UART)
Lesson 9- NodeMCU with Arduino UNO (UART)
 
Lesson 8- NodeMCU with Servo Motor
Lesson 8- NodeMCU with Servo MotorLesson 8- NodeMCU with Servo Motor
Lesson 8- NodeMCU with Servo Motor
 
Lesson 7- NodeMCU with DC Motor
Lesson 7- NodeMCU with DC MotorLesson 7- NodeMCU with DC Motor
Lesson 7- NodeMCU with DC Motor
 
Lesson 6 - NodeMCU with PWM Pin
Lesson 6 -  NodeMCU with PWM PinLesson 6 -  NodeMCU with PWM Pin
Lesson 6 - NodeMCU with PWM Pin
 
lesson4 - NodeMCU control led
  lesson4 - NodeMCU control led  lesson4 - NodeMCU control led
lesson4 - NodeMCU control led
 
lesson2 - Nodemcu course - NodeMCU dev Board
 lesson2 - Nodemcu course - NodeMCU dev Board lesson2 - Nodemcu course - NodeMCU dev Board
lesson2 - Nodemcu course - NodeMCU dev Board
 
lesson1 - Getting Started with ESP8266
lesson1 -  Getting Started with ESP8266lesson1 -  Getting Started with ESP8266
lesson1 - Getting Started with ESP8266
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
 
Embedded system introduction - Arduino Course
Embedded system introduction - Arduino CourseEmbedded system introduction - Arduino Course
Embedded system introduction - Arduino Course
 
Summary of MATLAB Functions-Part1
Summary of MATLAB Functions-Part1Summary of MATLAB Functions-Part1
Summary of MATLAB Functions-Part1
 
MATLAB Basics-Part1
MATLAB Basics-Part1MATLAB Basics-Part1
MATLAB Basics-Part1
 
Python basics_ part1
Python basics_ part1Python basics_ part1
Python basics_ part1
 

Recently uploaded

Recently uploaded (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Pyton with rasperry pi

  • 1. PYTHON WITH RASPBERRY PI Eng. Elaf Ahmed Saeed
  • 2. PROGRAMMING LANGUAGES • The programming languages ​​supported by Raspberry Pi are all the languages ​​supported by Linux, such as Python, Pascal, Java, and many other languages. We will use the python language in this course to program the GPIO control ports for the features that are available in this language over other languages ​​which we will list when introducing Python language.
  • 5. PYTHON • Python is one of the languages High-level and advanced programming. This language is characterized by its simplicity in writing and reading, easy to learn and open source which made it scalable. • Python can be used for various stages of programming from Through programming simple programs for beginners and reaching the completion of huge projects like any other programming language.
  • 6. PYTHON • Why did we choose Python to program Control ports? Because of the advantages that this language has over other languages. Perhaps the most important characteristic of it is the ease of learning this language and it is a free and open source language.
  • 7. PYTHON • Python Characteristics o Open source: You can freely read and edit the source code In which. o Easy to learn: due to the simplicity of writing and reading this language. o Practical: Works on all operating systems and their different versions o Code Libraries: There are a large number of software libraries available Supported by this language. o Support: Supported by the programming community in the World Wide Web Significantly. o GPIO: Supports programming of control ports on the Raspberry Pi
  • 9. PYTHON • Methods for working on the Python interpreter: 1. Python interpreter
  • 10. PYTHON • Methods for working on the Python interpreter: 2. Command line: by typing The next command on the command line  Python
  • 11. PYTHON • Methods for working on the Python interpreter: 3. A text file with the extension (py).
  • 12. BASIC PYTHON OPERATIONS • printing • print "text" • Example 1: Print “Hello Raspberry pi”
  • 13. BASIC PYTHON OPERATIONS • Writing (print) • print ‘ “ text ” ’ • Example 2: print 'Hello "Raspberry" Pi’
  • 14. BASIC PYTHON OPERATIONS • Comments • And to make a specific comment in your program what you need Except tick the box (#) followed by the comment you want. • Example: # Show the following text on screen print "Hello Raspberry Pi
  • 15. BASIC PYTHON OPERATIONS • Comments • It is possible to benefit from the process of ignoring the translator For comments invalidate a specific line of code. • Example # Show the following text # on screen print "Hello" # print "HelloWorld" print "Raspberry Pi"
  • 16. BASIC PYTHON OPERATIONS • Calculations • Python has the advantage of its ability to do operations Arithmetic such as: addition, subtraction, multiplication, and division Without prior definition of variables. Can do So with the following command. Number*Number • Example: 5*5
  • 17. BASIC PYTHON OPERATIONS • Calculations • It is also possible to link between the printing process and the calculations, for example Number*Number • Example: print "The result of addition 5+5 is ", 10
  • 18. BASIC PYTHON OPERATIONS • Variables • The variables are defined by typing the variable name Followed by its value between the sign equals and this is done through the following command: Var=Value • Example 1:x=5
  • 19. BASIC PYTHON OPERATIONS • Variables • Example 2: Raspberry = 50 pi = 50 print " Raspberry + Pi =" , Raspberry + pi print "Raspberry - Pi =", Raspberry - pi
  • 20. BASIC PYTHON OPERATIONS • Variable type • To find out the type of the variable we write the word type followed byWith the variable in parentheses Type(Var_Name) • Example: type(x)
  • 21. BASIC PYTHON OPERATIONS • if statement if expression : Statement(s) Example: pi=50 raspberry =50 if pi == raspberry: print "Hello Raspberry
  • 22. BASIC PYTHON OPERATIONS • if-else (if-else statement) if expression : Statement(s) else: Statement(s)
  • 23. BASIC PYTHON OPERATIONS • if-else (if-else statement) Example: pi=60 raspberry =60 if pi == raspberry: print "Hello Raspberry pi" else: print "Hello"
  • 24. BASIC PYTHON OPERATIONS • while loop while expression : Statement(s)
  • 25. BASIC PYTHON OPERATIONS • while loop Example: count=1 while (count<10) : print "The number of letters of raspberry" , count count= count + 1
  • 26. BASIC PYTHON OPERATIONS • List • It is a list that contains a number of values, The value is specified with a quotation mark and between Each value is a comma and all values are in between Square brackets
  • 27. BASIC PYTHON OPERATIONS • List list_Num=[ 1 , 2 , 3 , 4 , 5 ] list_Lett=[ "R", "a", "s","p", "b", "e","r","r","y"] list_Mix=[1, 2 , "a", "b"]
  • 28. BASIC PYTHON OPERATIONS • List • Example: list_Num=[ 1 , 2 , 3 , 4 , 5 ] list_Lett=[ "R", "a", "s", "p","b", "e","r","r","y"] list_Mix=[1,2 , "a", "b"] print " List_Num in position 2 is ", list_Num[2] print " list_Lett in position 0 is ", list_Lett [0] print " list_Mix in position 3 is ", list_Mix [3]
  • 29. BASIC PYTHON OPERATIONS • for loop for iterating_var in sequence: Statement(s) • Example: list_Num=[ 1 , 2 , 3 , 4 , 5 ] list_Lett=[ "R", "a", "s", "p", "b", "e","r","r","y"] list_Mix=[1,2 , "a", "b"] print " List_Num in position 2 is ", list_Num[2] print " list_Lett in position 0 is ", list_Lett [0] print " list_Mix in position 3 is ", list_Mix [3]
  • 30. BASIC PYTHON OPERATIONS • for loop • Example: List_Lett=[ "R", "a", "s", "p", "b", "e","r","r","y"] for letter in list_ Lett: print "letters of raspberry pi", letter
  • 31. Eng. Elaf Ahmed Saeed • Email: elafe1888@gmail.com • linkden: www.linkedin.com/in/elaf-a-saeed-97bbb6150 • facebook: https://www.facebook.com/profile.php?id=100004305557442 • github: https://github.com/ElafAhmedSaeed • youtube: https://youtube.com/channel/UCE_RiXkyqREUdLAiZcbBqSg • slideshare: https://www.slideshare.net/ElafASaeed • Slideplayer: https://slideplayer.com/slide/18029243/ • Google Scholar: https://scholar.google.com/citations?user=VIpVZKkAAAAJ&hl=ar&gmla=AJsN- F7PIgAjWJ44Hzb18fwPqJaaUmG0XzbLdzx09