...

/

Hands-On Coding

Hands-On Coding

Get some hands-on practice with the concepts you have learned so far.

In this lesson, we will work toward building our very first Python project using the coding elements that we have learned so far. Using coding, we can even automate our day-to-day tasks. Let's consider this for a scenario. You go to a restaurant and get a bill at the end of your meal. You want to give 20% of the total as a tip to the waiters for their hospitality. For a simple amount, one may do some mental math and calculate it as illustrated in the slides below.

Press + to interact
canvasAnimation-image
1 / 5

However, sometimes the bill amount can be a bit odd and it is difficult to calculate the amount to be given as a tip. For this project, let's make a tip calculator that we can use every time we want to give at a restaurant. This calculator should take the total amount and the percentage of it that you would want to give as a tip as inputs, and output the tip amount rounded off to the nearest dollar. Below is a representation of what our final project should look like. Try ...