
Learning Objectives
In this challenge we are learning how to use variables to store the characteristics of your house. Some of our variables will be used to store text (string) such as the street name of your house. Some variables will be used to store numbers, either whole numbers (integers) or numbers with a decimal place (reals/floats). For instance we could use a variable called numberOfBedrooms.
Once we have stored all the characteristics of our house we will use the print command in Python to print a full description of our house.
Using variables
Look at the example below to see how text (string) and numbers (integers or reals) are stored using variables.
streetName = "Turing Street" typeOfHouse = "detached" numberOfBedrooms = 3 price = 99999.99
Have you noticed the use of “speech marks” when storing a string?
Step #1
Use the trinket below to store the street name, town, type of house (terraced, semi-detached, detached, flat). Don’t forget the use of “speech marks”.
Step #2
Now save the number of bedrooms, number of reception rooms, number of floors and selling price of your house, using numerical values. You will not need to use speech marks.
Step #3
We will now use the print command to display a description of our house on screen.
We will combine statements such as “My house is located on ” and variables (such as streetname) to create a clear description of our house. To do this we will use the + operator.
Tip:
When combining two strings or a statement and a string variable we use the + operator. For instance:
print("A lovely " + typeOfHouse + " located on " + streetName + ".")
When combining a string or a statement with a numerical variable (integer or real) we have to cast (convert) this number into a string using the str() function. For instance:
print("This house consists of " + str(numberOfBedrooms) + " bedrooms.")

Your Challenge
Complete your code to create a complete description of your house. For instance:
Extension:
Can you think of additional characteristics to describe your house? For instance number of bathrooms, etc.
Create more variables to store these new characteristics and complete your description of your house.
Challenge #2
Using if statements we can tell the computer whether to execute some lines of codes or not. Let’s create a few more variables to store whether or not your house has:
- A front garden,
- A back garden,
- A swimming pool,
- A garage,
- etc.
Then, using if statements, we will decide whether or not to add information to our description.
For instance:
frontGarden = True
if frontGarden == True:
print ("This house also benefits from a lovely front garden.")
Complete your code adding extra characteristics to your house and displaying a message when relevant using if statements.

Solution...
The solution for this challenge is available to full members!Find out how to become a member:
➤ Members' Area


In this post we will use Python 2 and Minecraft to create a virtual trampoline for Minecraft. We will first build the trampoline using Minecraft blocks (in Python). Then we will write a routine to make the main player bounce up and down on the trampoline.
Before getting started you need to understand how the (x,y,z) coordinates are used to retrieve the position of the player in the minecraft world or to add blocks at the right position. As you can see on the picture to the left, it is slightly confusing as the vertical axis is not the z axis but the y axis.


letour.txt
In this challenge we are going to use our coding skills to create some nice colour patterns. We will first look at the code given to create a rainbow effect to understand how it works. We will then adapt this script to create three other colour patterns.



This tutorial is the third tutorial in a series of five Pygame tutorials:
We need your coding skills to locate the treasure of Captain Redbeard. The legend holds that Redbeard was a great pirate who sailed the Caribbean Sea, fiercely attacking any vessels from the British Navy he would encounter.


