Python - Section 8 Practice Tasks

Task One

Write a program with a blank list.

Use the .append() command to add your three favourite ice-cream flavours to this list and then print the list.

Example solution:

Task Two

Write a program with a list of 5 random numbers.

Print the list.

Delete the first and third numbers. Print the list.

Example solution:

Task Three

Write a program with a list of three random animals.

 

Write an input line that lets the user type an animal.

 

Add what the user has written to the list and print the list.

Example solution:

Task Four

Sort your list from task two into order.

 

Then print the list.

Example solution:

Task Five

Create a dictionary (see 8c) that asks users questions about yourself, such as first name, favourite colour or birthday.

Let the user answer each question and display the answer if they get it correct. Use the 'Using a Dictionary to Make a Game' section of 8c to help you.

Example solution:

© CSNewbs 2020