livepython.net

57. Python Program to Split a Bill Between Friends

MediumInteractive

Overview

Mix float and int input in one program.

Problem Statement

Read the bill total (it may have decimals), then the number of friends, and print what each friend pays, with two decimal places. For example, for 1000 and 3, print:

Each friend pays 333.33

Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.

Input

One value per line, in this order. Example:

1000
3

Output

The output for that example:

Each friend pays 333.33

The tests try 3 different inputs.

Learn this firstChapter 7 · Build Small Interactive Python Programs
solution.py
# write your code here

EXPECTED OUTPUT

1Each friend pays 333.33

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.