562 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
This exercise asks you to write a program which displays your Hogwarts house colours given your input house name. Here's what a typical output should look like when you run the program:
Ravenclaw: the forgotten Harry Potter house?
First create a new program file called Sorting Hat.py, and set a variable to hold the house name typed in by a user.
To make it easier to test the value of your variable add .lower() to the end of it (this will convert whatever the user types in into lower case).
Before the next part of the exercise you'll need to know the Hogwarts house colours, which are:
Scarlet and yellow (of course)
Yellow and black
Blue and bronze
Green and silver (hissss ... !)
Write an if ... elif ... else block which sets the value of another variable to the correct house colours (if the house typed in by your user doesn't exactly match any of the ones listed above, your program should set your colours to Not known).
Use the else clause of your if condition to return this message if a user types in an unknown house name.
Remember that you can use \n within a text string to throw a carriage return to get the new lines shown in our example.
Test that your program works by trying a few different house names, then save and close it.
25 Aytoun Street