-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmol4.py
25 lines (18 loc) · 832 Bytes
/
mol4.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
print ("********************************************************************")
print ("This program is designed to calculate the sum of molecular mass")
print ("and amino acid mass in dalton")
print ("********************************************************************")
# Function to add two values
def add_two_numbers():
# Take input from the user
num1 = input("Enter the molcular formula mass: ")
num2 = input("Enter the amino acid (protien) molcular weight: ")
try:
# Convert inputs to float and add them
result = float(num1) + float(num2)
print(f"The sum of molcular formula mass {num1} and amino acid {num2} is: {result}")
except ValueError:
print("Please enter valid numbers.")
# Call the function
add_two_numbers()
input ("Enter to exit")