Answer: Yes python allows an if statement to occur within the definition of a function.
Explanation:
for example: write a Python function to tell whether the number is positive or not. The function should return Yes if positive and No if negative.
def function_positive_negative(x):
if x>0:
return "Yes"
else:
return "No"
def main():
x=input("enter a number")
print(function_positive_negative(x))