a = int(input("Enter first integer: "))

b = int(input("Enter second integer: "))

print("Result is :", format((a/b), '.2f'))

"""
Explanation: Programming Exercises
P1:
Write a Python program that prompts the user for two integer values and displays the result of the first number divided by the second, with exactly two decimal places displayed.

Solution:
End of explanation
"""


a = float(input("Enter first float: "))

b = float(input("Enter second float: "))

print("Result is :", format((a/b), '.6f'))

"""
Explanation: P2:
Write a Python program that prompts the user for two floating-point values and displays the result of the first number divided by the second, with exactly six decimal places displayed.

Solution:
End of explanation
"""


inp = input("Enter a upper or lower case letter: ")

print("Here is the ASCII encoding of your number: " + str(ord(inp)))

"""
Explanation: P3:
Write a Python program that prompts the user to enter an upper or lower case letter and displays the corresponding ASCII encoding.

Solution:
End of explanation
"""


print(format((sum([2**i for i in range(64)])/7000), '.1f'))

"""
Explanation: Development Problems
D1: Losing Your Head over Chess 
The game of chess is generally believed to have been invented in India in the sixth century for a ruling
king by one of his subjects. The king was supposedly very delighted with the game and asked the sub-
ject what he wanted in return. The subject, being clever, asked for one grain of wheat on the fi rst
square, two grains of wheat on the second square, four grains of wheat on the third square, and so forth,
doubling the amount on each next square. The king thought that this was a modest reward for such an
invention. However, the total amount of wheat would have been more than 1,000 times the current
world production.

Develop and test a Python program that calculates how much wheat this would be in pounds, using
the fact that a grain of wheat weighs approximately 1/7,000 of a pound.

Solution:
End of explanation
"""


age = 20
total_breaths = 45*60*24*365
age -= 1
total_breaths += 25*60*24*365*3
age -= 3
total_breaths += 20*60*24*365*9
age -= 9
total_breaths += 16*60*24*365*7

heart_beats = 67.5*60*60*24*365*20

print("20 years old person had breath approximately: ", total_breaths , " times")
print("20 years old person had heartbeats approximately: ", heart_beats , " times")

"""
Explanation: D2: Life Signs    
Develop and test a program that determines approximately how many breaths and how many heartbeats the 20 year old person has had in their life. The average respiration (breath) rate of people changes during different stages of development. Use the breath rates given below for use in your program:

                     Breaths per Minute
Infant               30–60 
1–4 years            20–30 
5–14 years           15–25     
adults               12–20
For heart rate, use an average of 67.5 beats per second.

Solution:
End of explanation
"""


