Otherwise know as remixing, I like to give students the opportunity to play and experiment with existing code. When making the transition from block based to text based code, I want my students to focus on the problem solving and logic and not hung up on the syntax. Allows students to play and experiment with code to gain a better understanding. They can then build on that.
Examples:
Welcome to the weather checker program! Today you are going to write a program which advises the user on how to dress for the weather today. The first thing we are going to do is welcome our user with a greeting.
print("Welcome to the weather checker!")
2. Next, let's ask the user to tell us the current weather outside.
weather = input("What is the weather outside? Is it cloudy(c), sunny(s), or rainy(r)")
3. Now, we are going to write some conditional also known as if/else statements. This first one is checking the value of the variable weather. If it equals r, then the program will display the message below.
if weather == "r":
print("You need an umbrella today")
4. This next line is also checking the value of the variable weather. If it equals s, then the program will display the message below.
elif weather == "s":
print("Don't forget your sunglasses!")
5. This last line will display the message below if neither of the above two conditions are true.
else:
print("No need to bring anything extra for the weather today!")
**************************************************************************
Your Challenge:
Add another block of conditional statements which checks for the temperature and responds accordingly. For example, it might display, "Wear shorts today, it's going to be hot!" or "Bundle up, it's freezing out there!" You need at least three conditions.
Here's a code snippet to get you started:
temp = int(input("what is the temperature today?"))
Resources:
https://medium.com/mit-media-lab/studying-the-relationship-between-remixing-learning-c1df54c302df