0
0
Raspberry Piprogramming~20 mins

Why automation runs tasks without human intervention in Raspberry Pi - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Automation Mastery on Raspberry Pi
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Why does automation run tasks without human intervention?

Which of the following best explains why automation systems on a Raspberry Pi can run tasks without human intervention?

ABecause the Raspberry Pi has a built-in AI that decides when to run tasks automatically.
BBecause automation only works when the Raspberry Pi is connected to the internet.
CBecause the Raspberry Pi requires a user to press a button to start every task manually.
DBecause automation scripts are scheduled or triggered by events, allowing tasks to run on their own.
Attempts:
2 left
💡 Hint

Think about how tasks can start without someone physically doing something each time.

Predict Output
intermediate
1:30remaining
Output of a scheduled task script

What will be the output when this Python script runs automatically every minute on a Raspberry Pi?

Raspberry Pi
import datetime
print(f"Task ran at {datetime.datetime.now().strftime('%H:%M')}")
ATask ran at 12:00 (or current time when run)
BSyntaxError because datetime is not imported correctly
CNo output because the script needs user input
DTask ran at 00:00 always
Attempts:
2 left
💡 Hint

Look at how the script prints the current time when it runs.

🔧 Debug
advanced
2:00remaining
Why does this automation script fail to run automatically?

This Python script is supposed to run automatically on a Raspberry Pi using cron, but it never runs. What is the most likely reason?

print('Hello from automation')
AThe print statement is incorrect syntax in Python 3.
BThe script lacks a shebang line and executable permission, so cron cannot run it.
CCron jobs cannot run Python scripts on Raspberry Pi.
DThe script needs an input() call to start.
Attempts:
2 left
💡 Hint

Think about what cron needs to run scripts automatically.

📝 Syntax
advanced
1:30remaining
Identify the syntax error preventing automation

Which option contains a syntax error that would stop this automation script from running on a Raspberry Pi?

for i in range(3):
    print(f"Run {i}")
A
for i in range(3):
    print("Run {i}")
B
for i in range(3):
    print(f"Run {i}")
C
for i in range(3)
    print(f"Run {i}")
D
for i in range(3):
print(f"Run {i}")
Attempts:
2 left
💡 Hint

Look for missing punctuation that Python requires.

🚀 Application
expert
2:30remaining
How to trigger automation on Raspberry Pi without human action

You want your Raspberry Pi to turn on a light automatically when it gets dark, without pressing any buttons. Which method below best achieves this automation?

AWrite a script that checks a light sensor value and runs continuously to turn on the light when dark.
BManually run a script every time you want the light to turn on.
CConnect the light to a switch and press it when it gets dark.
DUse a script that only runs once when the Raspberry Pi boots and never checks the sensor again.
Attempts:
2 left
💡 Hint

Think about how the Raspberry Pi can watch for changes and act automatically.