Practice Exercise 1
1. Write a program to print out the number of seconds in a 30 day month.
2. Write a program in Python to print out the number of seconds in a year.
3. Using Python as a calculator, work out the following problem:
a. A high-speed train can travel at an average speed of 150mph. How long will it take a
train travelling at this speed to travel from London to Glasgow which is 414 miles
away?
Give your answer in minutes.
………………………………………………………………………………………………………………………………
4. Using the help facility on Python. Type help() to start the online facility, then “keywords” to
view the keywords that are available in Python. Get help on the “if” keyword.
5. Use Python to calculate the following:
a. 49/7
b. 8**2
c. 20%3
d. 17//3
e. 7**3
6. Use Python to evaluate the following:
a. If you are going on holiday to France, how many Euros would you get when you
convert £500 at an exchange rate of £1 = €1.20
………………………………………………………………………………………………………………………….
b. On return from your holiday, you now have €320. How many GBP would you
receive at an exchange rate of £1 = €1.32.
………………………………………………………………………………………………………………………….