So i have created a function and inside i had put an if command, to check for the answer, but when the answer is invalid i want to repeat the function so it asks again. It is supposed to ask for either input A or B but when for eg i put C it should call back on the function and repeat. How do i make it re-ask for the input? This is what i tried:
def function():
data = input("A/B")
if data == "A":
print("A")
elif data == "B":
print("B")
else:
function() #<-----problem here