# Can try-except be used to catch invalid keyboard input?
# Can try-except catch the error if a file can’t be opened?

try:
    x = input("Enter number x: ")
    x = x + 1
    print(x)

except:
    print("Invalid input, enter a number")


try: 
    f = open("test.txt")
except: 
    print('Could not open file')
finally:
    f.close()

print('Program continue')

49ba5d73c7455d87753bfca60845c88316a83e7b
<mask token>

try:
    x = input('Enter number x: ')
    x = x + 1
    print(x)
except:
    print('Invalid input, enter a number')
try:
    f = open('test.txt')
except:
    print('Could not open file')
finally:
    f.close()
print('Program continue')

# Can try-except be used to catch invalid keyboard input?
# Can try-except catch the error if a file can’t be opened?

try:
    x = input("Enter number x: ")
    x = x + 1
    print(x)

except:
    print("Invalid input, enter a number")


try: 
    f = open("test.txt")
except: 
    print('Could not open file')
finally:
    f.close()

print('Program continue')
