Parsons problems are essentially lines of mixed up code. I like them because students are forced to think about the logic of their program and not get hung up by the syntax. I found this type of problem is useful when I teach a new text based language.
Tools to use:
Your task is to create a magic 8 ball problem. All the code you need is listed below. Add them to your program in the correct order. Remember, this lines of code are NOT in the right order!
print(answer)
question=input("What is your question?")
import random
fortune = ['yes', 'no', 'absolutely', 'maybe', 'unsure', 'of course', 'without a doubt', 'never']
answer=random.choice(fortune)
print("Welcome to the magic 8 ball")