The City School
Iqbal Campus, Sialkot
Prep Section
2nd Computer Test
Computing Test: Programming Robotics and Single Board Computers M.M: 20
Name: Class/Section: 8 Date: Monday (14-04-25)
Q1: Choose the best answer. /5
1. Raspbian is a ____________ based computer operating system for Raspberry pi.
a. Google c. Microsoft
b. Architecture d. Debian
2. ______________ is not the conditional operator.
a. = c. >
b. < d. #
3. The __________ keyword catches anything which isn’t caught by the preceding condition.
a. If c. Else
b. Elif d. Then
4. ______________ is not the logical operator.
a. AND c. OR
b. NOT d. AND NOT
5. A _____________ loop is used for repeating over a sequence.
a. While loop c. For loop
b. Repeat until d. Do while loop
Q2: True and False. /5
i. Bumble pi is an educational robot kit. __________
ii. HDMI connector to connect a monitor or TV. __________
iii. GPIO pins can simply be used to turn devices on and off. __________
iv. Python is a High – Level language. __________
v. Resistor is important to build a blinking LED project. __________
Q3: How many USB and LAN ports are there on Raspberry Pi? /1
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
Q4: Explain the code given below: /2
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(18,GPIO.OUT)
while True:
GPIO.output(18,True)
time.sleep(0.5)
GPIO.output(18,False)
time.sleep(0.5)
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
Q4: State the equipment needed for blinking LED project. /3
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
Q5: What are conditional and logical operators used for? /2
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
Q6: State the use of GPIO pins. /2
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________