Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # P1.py
- #
- # prompts user for two interger values, print the result of the first number
- # divided by the second number, with exactly two decimal places.
- #
- # date: 08/28/2016
- # author: Chiayo Lin
- # license: GPL 3.0
- # this is a simple and scalable way to get user's input into a list with a
- # different prompt each time so i think it would be a good idea to use map()
- # with an inline function.
- integers = list(map(lambda prompt: \
- int(input("Enter the " + prompt + " integer: ")), ("first ", "second")))
- print(format((integers[0] / integers[1]), '.2f'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement