This is what I tried and , basically what I was trying to do was that, if a user enters other than 1,2,3,4,6 then it will go back to a=int(input.....)). But for me it keeps giving output as None.
def hi():
while True:
try:
a=int(input("enter the denominator of Pi radian\n"
"(choose from 1,2,3,4,6)\n"
"Enter here:"))
if a <=0 or a>=7 and a!=5:
print("Enter the given digits")
else:
return a
except Exception:
print("enter a valid type")
ant=hi()
print(ant)