# -*- coding: utf-8 -*-
"""
Created on Thu Jul  4 19:56:09 2019

@author: Abirmoy
"""
#########################################################################

# PROBLEM 1
#def ask_for_int():
#    while True:
#        try:
#            result = int(input("Please provide number: "))
#        except:
#            print("Whoops! Not a number.")
#            continue
#        else:
#            print("Yes thank you")
#            break
#        finally:
#            print("End of try,except,finally")
#            print("I will always run at the end.")
#
#ask_for_int()

##########################################################################
# PROBLEM 2

# MIGHT HAVE ERROR
#try:
#    x = 5
#    y = 0
#    
#    z = y/x
#
## IF THERE IS ANY ERROR BLOCK BELLOW RUNS
#except ZeroDivisionError:
#    print("Your code has zero division error")
#
## IF NO ERROR FOUND
#else:
#    print("Code has no error.")
#
## ALWAYS EXECUTES NO MATTER WHAT
#finally:
#    print("Final runs always")


##########################################################################


# PROBLEM 3

#def get_int():
#    
#    while True:
#        try:
#            number = int(input("Input a number: "))
#        except:
#            print("invalid type, try again.")
#            continue
#        else:
#            break
#    print("Square of your number: ", number**2)
#
#
#get_int()
#
#
#
#
#
#
