'''This code is risky, because the program will crash 
   if the user enters something that cannot be 
   converted to an integer.'''

print("\nTrusting the user to enter a valid integer...")

user_input = input("\tEnter an integer: ")
number = int(user_input)
doubled = number * 2
print("\tDoubled number:", doubled)

''' This code will run in a loop until the user enters 
    a valid integer.  If the user enters something that 
	cannot be converted to an integer, it will catch the 
	ValueError and prompt the user to try again. '''

print("\nNOT Trusting the user to enter a valid integer...")

while True:
	user_input = input("\nEnter an integer: ")
	try:
		number = int(user_input)
		doubled = number * 2
		print("\tDoubled number:", doubled)
		break
	except ValueError:
		print("\tThat is not a valid integer. Try again.")
