0
0
Raspberry Piprogramming~15 mins

Raspberry Pi vs Arduino comparison - Hands-On Comparison

Choose your learning style9 modes available
Raspberry Pi vs Arduino Comparison
📖 Scenario: You are working on a simple program to compare two popular microcontroller platforms: Raspberry Pi and Arduino. This will help beginners understand their differences by listing key features side by side.
🎯 Goal: Create a Python dictionary to store features of Raspberry Pi and Arduino, then filter and display features that are unique to Raspberry Pi.
📋 What You'll Learn
Create a dictionary called devices with two keys: 'Raspberry Pi' and 'Arduino'.
Each key should map to a list of features as strings.
Create a variable called unique_to_pi to hold features that are only in Raspberry Pi's list but not in Arduino's.
Print the list unique_to_pi.
💡 Why This Matters
🌍 Real World
Comparing features of hardware platforms helps beginners choose the right tool for their projects.
💼 Career
Understanding differences between microcontrollers and microcomputers is useful for roles in embedded systems and IoT development.
Progress0 / 4 steps
1
Create the devices dictionary
Create a dictionary called devices with these exact entries: 'Raspberry Pi' mapped to the list ["Runs Linux", "Has HDMI output", "Supports WiFi"] and 'Arduino' mapped to the list ["Microcontroller", "No OS", "Low power consumption"].
Raspberry Pi
Need a hint?

Use curly braces {} to create a dictionary. Each key is a string and maps to a list of strings.

2
Create a variable for unique Raspberry Pi features
Create a variable called unique_to_pi and set it to an empty list [].
Raspberry Pi
Need a hint?

Just write unique_to_pi = [] to start with an empty list.

3
Find features unique to Raspberry Pi
Use a for loop with the variable feature to go through devices['Raspberry Pi']. Inside the loop, use an if statement to check if feature is NOT in devices['Arduino']. If so, append feature to unique_to_pi.
Raspberry Pi
Need a hint?

Use for feature in devices['Raspberry Pi']: and inside check if feature not in devices['Arduino']: then append.

4
Print the unique Raspberry Pi features
Write print(unique_to_pi) to display the list of features unique to Raspberry Pi.
Raspberry Pi
Need a hint?

Use print(unique_to_pi) to show the list.