python-by-example-150-chall.../challenges1-11/challenage-008.py

5 lines
243 B
Python
Raw Permalink Normal View History

2019-07-17 14:56:46 +08:00
bill_price = int(input('Please enter bill total price : '))
number_of_diners = int(input('Please enter diners number : '))
2025-05-26 06:49:34 +08:00
# round(数值, 小数点位数)
2019-07-17 14:56:46 +08:00
print('the price for each person is {0}'.format(round(bill_price/number_of_diners,2)))