Question
Write code snippets to do the following. You should write these in a Python editor and test them out as you go. When they work,
Write code snippets to do the following. You should write these in a Python editor and test them out as you go. When they work, copy and paste your final code snippet here.
Definea function that takes a total bill and the number of people at your table, and prints the amount that each person owes.
e.g. divide_bill(100, 5) would produce
Each person owes $20 for their meal.
e.g. divide_bill(50.25, 4)would produce
Each person owes $12.56 for their meal.
Note that the decimal number above may not be exactly the same as what you get. Yours might say 20.0 or 12.5625, for instance. Well learn about how to round to exactly two decimal points later (for Added Fun you could google how to do it now).
Make sure that you test your function by calling it at least twice in your main with different parameters.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started