Python - Section 10 Practice Tasks

Task One

Create a file in Python called DaysOfTheWeek.txt.

Write the days of the week into the file in a single print line but put each day on a new line.

Check the file to see if it has worked.

Example solution:

Task Two

Create a file called Colours.txt.

Use a for loop to ask the user to enter 8 different colours.

Write each colour onto the same line, with a space between colour.

Close the file and open it again in read mode and print it.

Example solution:

Task Three

Create a file named "Holiday.txt".

Ask the user to enter the family name, destination and and number of passengers.

Print each family's details on their own line.

Bonus: Edit this program to add a search feature to look for the family name.

Example solution:

© CSNewbs 2019