Project Level 1: Beginner
This project is designed for beginner learners who are still learning and practicing Python fundamentals.
Project Description
Create a program that asks the user about the current weather and, using a dictionary for decision-making, suggests an activity.
Start the script with this dictionary on top of your script:
weather_activities = {
"1": "It's a beautiful day! How about a walk in the park? 🌳",
"2": "Perfect weather for a cozy indoor day with a good book! 📚",
"3": "Maybe it's a great time for a reflective cup of tea! ☕",
"4": "Build a snowman or have a snowball fight! ⛄"
}
Then, add more code so the program produces the following output.
Expected Output
(1) The program prompts the user to choose 1, 2, 3, or 4 depending on the current weather.
(2) Then, the program displays some text that belongs to the choice in the dictionary given further above.
Learning Benefits
Dictionaries for Decision-Making:
Practice using dictionaries to map inputs to outputs, reducing repetitive conditional statements.
Prerequisites
Required Libraries: No libraries are needed for this project.
Required Files: No files are needed for this project.
IDE: You can use any IDE on your computer to code the project.
Danger Zone
Once you code the project, compare it with our two solutions given in the button below.