#!/usr/bin/env python3; ############################################################################### # This program demonstrates how to prompt the user for input. # # Copyright © 2020 Richard Lesh. All rights reserved. ############################################################################### import Utils # Begin Main favorite_int = 0 favorite_long = 0 favorite_double = 0.0 try : FAVORITE_INT_INPUT = Utils.prompt("What is your favorite small integer? ") favorite_int = int(FAVORITE_INT_INPUT) FAVORITE_LONG_INPUT = Utils.prompt("What is your favorite large integer? ") favorite_long = int(FAVORITE_LONG_INPUT) FAVORITE_DOUBLE_INPUT = Utils.prompt("What is your favorite floating point? ") favorite_double = float(FAVORITE_DOUBLE_INPUT) except ValueError as ex : print("Bad input! " + str(ex)) except Exception as ex : print("Don't know what went wrong!") SUM = favorite_int + favorite_long + favorite_double print("All together they add up to {0:f}!".format(SUM))