In this set of robot programming challenges, you’ll help a robot complete different missions using Python code. Each task is a small part of a bigger system where the robot uses tools, checks its status, and interacts with users. Your job is to write functions that use input from the user, work with a shared list of tools, and return clear messages. These tasks are designed to help you practise important Python skills like loops, conditions, functions, and data types—all while building simple, useful programs for your robot.
Use this list for the task:
tools = ["laser cutter", "gripper arm", "solar panel", "wheels", "camera", "speaker", "sensor", "cooling fan"]
Function name: greet_user()
Purpose: Welcome the user and show the robot’s tools.
You must:
Use input() to ask the user for their name.
Use string concatenation to build a message with their name.
Use the tools list to show all available tools.
Return the full message as one string (don’t print it).
Wrap the logic in a function with the correct name.
Why:
Practises input, return, lists, and string handling.
Function name: generate_robot_name()
Purpose: Make a robot name and show how many tools it has.
You must:
Use input() to ask for a colour and an animal.
Use string concatenation to combine them into a robot name.
Use the tools list and len() to count how many tools exist.
Return a string with the robot name and tool count.
Put everything inside a function.
Why:
Reinforces data input, string manipulation, and counting list items.
Function name: check_battery()
Purpose: Give a warning if the battery is low or suggest a tool if high.
You must:
Use input() to ask for battery level.
Use int() to convert it to a number (type casting).
Use if / elif / else to decide the message.
Optionally use a tool from the list if battery is high.
Return the final message as a string.
Use a function to contain the logic.
Why:
Practises conditionals, type casting, and return values.
Function name: search_tool()
Purpose: Let the user ask for a tool and say if it exists.
You must:
Use input() to ask for the tool name.
Use in to check if it’s in the tools list.
Use if / else to return a message about the result.
Return the message as a string.
Use a function to structure the task.
Why:
Develops selection logic and use of the in operator with lists.
Function name: track_location()
Purpose: Show the robot’s location and available tools.
You must:
Use input() to ask where the robot is.
Use string concatenation to build a message with the location.
Add the tools list to the message.
Return the full message as a string.
Use a function to wrap everything.
Why:
Focuses on input handling, string creation, and using lists.
Function name: power_up_tools()
Purpose: Power up the robot’s tools one by one.
You must:
Use input() to ask if the robot should start.
Use if to check the answer.
If yes, use a for loop to go through the tools list.
Build a string using string concatenation for each tool.
Return the full message.
Place all logic in a function.
Why:
Practises loops, list traversal, conditional logic, and string building.
Function name: emergency_shutdown()
Purpose: Check for danger and shut down the robot if needed.
You must:
Use input() to ask if there is an emergency.
Use if to decide what to do.
If yes, use .clear() to empty the tools list.
Return a message about the shutdown.
Wrap all of this in a function.
Why:
Teaches decision-making with if statements and list manipulation.
Function name: add_tool()
Purpose: Add a tool to the robot and show the updated list.
You must:
Use input() to ask for the new tool.
Use .append() to add it to the tools list.
Use string concatenation to make a message showing the new tool and full list.
Return the message.
Write everything inside a function.
Why:
Practises list modification and clear string formatting.
Function name: show_tool_summary()
Purpose: Show a numbered list of all tools.
You must:
Use input() to ask if the user wants to see the summary.
Use if to check the answer.
Use len() to count the tools.
Use a for loop and enumerate() to create a numbered list.
Build a full string and return it.
All logic must be inside a function.
Why:
Combines input, lists, loops, and string formatting in one task.
Function name: mission_summary()
Purpose: Build a full report using user input.
You must:
Use input() to ask for the robot’s name and location.
Use the tools list to include current tools.
Use string concatenation to create a full mission message.
Return the message.
Use a function to organise your code.
Why:
Brings together all basic skills: input, variables, string formatting, and list usage.