Modules, More Math, and Debugging - Chapter 3

Functions (Covered more in Chpater 6)

Modules and Python versions

Functions in the Math Module

Tips for Programming with Greater Satisfaction and Less Frustration (Less Debugging)

Common Error Messages

In-class exercise: You're planning a wedding, and you need to transport all your wedding guests from the ceremony to the reception. A bus can carry 40 passengers. Please write a program to input the names of the bride(s) and groom(s), and how many guests are coming to the wedding. Then ouput the names of the couple, followed by how many busses are needed, and the number of extra people you could carry with those busses (empty seats). You might want to use the "ceil" function which is defined in the math module.

Sample Output:

'''
Please enter the name of the bride or groom: Noah
Please enter the name of the other bride or groom: Andy
How many guests are coming to your wedding? 70
For the wedding of Noah and Andy you will need 2 busses.
You will have space for 10 extra guests on those busses.
'''
'''
Please enter the name of the bride or groom: Ellen
Please enter the name of the other bride or groom: Mark
How many guests are coming to your wedding? 120
For the wedding of Ellen and Mark you will need 3 busses.
You will have space for 0 extra guests on those busses.
'''
busses.py: Solution to above in-class exercise