Question: Title: Building a Simple Python Program I. OBJECTIVES This iLab demonstrates how to create a simple Python program on the Raspberry Pi. Proper procedures are
Title: Building a Simple Python Program
I. OBJECTIVES This iLab demonstrates how to create a simple Python program on the Raspberry Pi. Proper procedures are used to program the following mathematical operation: Number 1 + Number 2 = Results.
II. PROCEDURE 1. Boot up the Raspberry Pi (RPi).
2. Once the RPi boots, the desktop should look similar to Figure 1.
Figure 1Raspberry Pi Desktop
3. Double-click on the IDLE icon (or highlight it, right-click, and then click Open). Be sure to use the IDLE icon, not the IDLE 3 icon (Figure 2).
Figure 2 IDLE
4. The desktop should look similar to the following Figure 3.
Figure 3IDLE Desktop
5. Click File, then New Window to open a window to create a program.
6. Enter the program below. Replace Put Your Name Here with your name.
Name = Put Your Name Here Class= ECT109 Assignment = Week 2 Lab 2
#------------------------------------------------------------------ # Add two numbers #------------------------------------------------------------------
print Name print Class print Assignment print a = input(Enter 1st Number: ) b = input(Enter 2nd Number: ) print A+B= ,a+b
Table 1iLab 2 Program
7. Click File, then Save to save your program. Save your file as FiLastNameLab2-2.py, where Fi is your first name initial and LastName is your last name.
8. To run your program, click Run, then click Run Module. You can also press the F5 key instead.
9. Fix any errors you may have. The approximate location of the first error will be highlighted.
10. Enter two numbers, one at a time as prompted. This Python program will add the two numbers, and display the results.
11. Exit all programs and return to the Raspberry Pi (RPi) desktop.
12. Open the Midori web browser (Figure 4).
Figure 4Midori Browser Icon
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
