samedi 30 mai 2020

How to add if else statement in python along with function defination

Sorry to bother i m new to coding just learning python. i just created some code by myself in python no error shows. but why if else statement not executing. can someone help.

code:

def name(f_name, age):
    return f"Hi, {f_name} {age}"
    if age <= 18:
        print("You are Not eligeble for The post")
    else:
        print("you are eligeble for post")


person = name("Aditya", 17)
print(person)

Aucun commentaire:

Enregistrer un commentaire