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:

© CSNewbs 2019