Python - Section 7 Practice Tasks

Task One

Example solution:

Create a program with three different subroutines (procedures).

 

One subroutine asks the user their name and prints a response.

The second asks for their age and prints a response.

The third asks for their favourite colour and prints a response.

 

Remember to write subroutines before the main program.

Task Two

Create a program that asks a user to input the length of a side in a square.

Write a function that takes this value and returns it to be printed.

Example solution:

Task Three

Example solution:

Create a program that takes 3 inputs from the user – a name, a villain and a place.

 

Write a function that outputs a story using the user’s answers.

© CSNewbs 2019