<jupyter_start><jupyter_text>Errors and Exceptions Homework -  Problem 1Handle the exception thrown by the code below by using try and except blocks.<jupyter_code>try:
    for i in ['a','b','c']:
        print(i**2)
    
except: 
    print ('Error, operation not supported.')<jupyter_output>Error, operation not supported.<jupyter_text>Problem 2Handle the exception thrown by the code below by using **try** and **except** blocks. Then use a **finally** block to print 'All Done.'<jupyter_code>x = 5
y = 0

try:
    z = x/y
    
except:
    print('Error, division by zero.')
    
finally:
    print('Operations complete.')<jupyter_output>Error, division by zero.
Operations complete.<jupyter_text>Problem 3Write a function that asks for an integer and prints the square of it. Use a while loop with a try,except, else block to account for incorrect inputs.<jupyter_code>def ask():
    
    while True:
        try:
            var = int(input('Input an interger: '))
            
        except:
            print('An error occured. Pleas try once again.')
            continue
            
        else:
            print('Thank you. Your number when squared is:',var**2)
            break
ask()<jupyter_output>Input an interger: 5
Thank you. Your number when squared is: 25
StarcoderdataJupyterStructuredCleanDedup