You are on page 1of 1

.

Starter – Magic Trick


This is our last Python task. I bet some of you have just went ‘Phew’ 

Let’s see if we can have some fun and pull a rabbit out of a hat.

Part 1
 We are going to make a program
 Open up a new window.
 Save the window as Magic Trick.
 Write the following code into your window.

def pullrabbit():
print(" /\ ")
print(" //\\ /\ ")
print(" /' \\ //\\ ")
print(" \\ // `\ ")
print(" \\ // ")
print(" .-'^'-. ")
print(" .' a___a `. ")
print(" == (___) == ")
print(" '. ._I_. .' ")
print(" ____/.`-----'.\____ ")
print(" [###(__)#####(__)###]")
print(" ~~|#############|~~ ")
print(" |#############| ")
print(" |#############| ")
print(" |#############| ")
print(" |#############| ")
print(" ~~~~~~~~~~~~~~~ ")

magicword = input("Enter the magic word: ")


if magicword == "abracadabra":
pullrabbit()
else:
print ("That's not a magic word")
 Save the code and click execute.
 What does the code do?
 The code …………………….

Fix the program.

1. To ask the user for a number. If they enter number 1 if displays ‘epic fail’, any other
number entered should display ‘Nice number’.

You might also like