## Check if a rectangle is a square# reusable functiondef is_square(length, width):return length == widthwhile True:length = input("Give me length of a rectangle: ")try:length = int(length)except:print('You have to type a number!')if type(length) is int:breakwhile True:width = input("Give me width of a rectangle: ")try:width = int(width)except:print('You have to type a number!')if type(width) is not int:print('You have to type a number!')elif type(width) is int:break# Check if is square using functionif is_square(length, width):print('It is a square!')else:print('It is not a square!')