So, the problem is write a void function which takes a 4 digit number and add the square of first two digit and last two digit.
and my solution is
def add():
print("Enter a 4 Digit number")
num = int(input())
if 999 < num < 10000:
c = int(num[0:2])
d = int(num[2:4])
e = (c ** 2) + (d ** 2)
print(e)
else:
print("Enter a valid number")
add()
#it shows error: 'int' object is not subscriptable