Which of the following best explains why automation systems on a Raspberry Pi can run tasks without human intervention?
Think about how tasks can start without someone physically doing something each time.
Automation runs tasks without human intervention because scripts or programs are set to start automatically by schedules (like timers) or by specific events (like a sensor detecting something). This means the Raspberry Pi can do work on its own.
What will be the output when this Python script runs automatically every minute on a Raspberry Pi?
import datetime print(f"Task ran at {datetime.datetime.now().strftime('%H:%M')}")
Look at how the script prints the current time when it runs.
The script prints the current time when it runs. If scheduled every minute, it will print the time at each run, like 'Task ran at 12:00'.
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')Think about what cron needs to run scripts automatically.
Cron requires scripts to have a shebang line (like #!/usr/bin/env python3) and executable permission to run them automatically. Without these, the script won't run.
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}")Look for missing punctuation that Python requires.
Option C is missing the colon ':' after the for statement, causing a SyntaxError. The colon is required to start the loop block.
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?
Think about how the Raspberry Pi can watch for changes and act automatically.
Running a script that continuously checks the sensor allows the Raspberry Pi to detect darkness and turn on the light automatically without human intervention.