Choose the best description of what a Raspberry Pi is mainly used for.
Think about a device that helps beginners learn coding and build simple projects.
The Raspberry Pi is a tiny, low-cost computer designed to help people learn programming and create electronics projects. It is not a gaming console, smartphone, or cloud server.
Assuming you run this Python code on a Raspberry Pi, what will be the output?
import platform print(platform.machine())
Raspberry Pi uses an ARM processor architecture.
The Raspberry Pi uses an ARM processor, so the platform.machine() function returns 'armv7l' or similar ARM architecture string, not x86 or i386.
Look at this Python code snippet for controlling a Raspberry Pi GPIO pin. Why does it raise an error?
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(18, GPIO.OUT) GPIO.output(18, True)
BOARD mode uses physical pin numbers, not BCM GPIO numbers.
In BOARD mode, pin numbers correspond to physical pins on the header (1 to 40). Pin 18 is a BCM GPIO number, not a BOARD pin number, so using 18 causes an error.
Choose the correct Python code snippet to initialize SPI communication using the spidev library on a Raspberry Pi.
Check for correct class name casing and method calls.
Option A correctly creates an instance of SpiDev with correct casing, opens bus 0 device 0, and sets max speed. Option A misses setting speed, C misses parentheses for class instantiation, D opens bus 1 which may not be available.
Consider the Raspberry Pi 4 Model B's 40-pin header. How many pins can you use as general-purpose input/output (GPIO) pins?
Not all 40 pins are GPIO; some are power, ground, or special function pins.
The Raspberry Pi 4 Model B has 40 pins on its header, but only 26 of these are usable as GPIO pins. The rest are power, ground, or reserved pins.