Please use your Python system (IDLE or something else) to compute the following. Be prepared to show your work!
Answer:
try:
# read in the numbers
val1 = int(input("First number> "))
val2 = int(input("Second number> "))
except:
# oops – something went wrong
print("Both numbers must be integers")
else:
# got the numbers; now compare
if val1 < val2:
print(val1, "is less than", val2)
elif val1 > val2:
print(val1, "is greater than", val2)
else:
print(val1, "and", val2, "are equal")
|
MHI 289I, Programming for Health Informatics Version of October 14, 2020 at 11:50PM
|
You can also obtain a PDF version of this. |