python 2.7 - How to decide whether if run a function by user in script -
i got 2 function in script :
def a(): print a
def b(): print b
how decide whether if run function 'b' user? advance
#at starting of script take username input name = raw_input("enter name : ") name.lower() #to make input name lowercase if name == 'bob': #name have call b b() else: a()
Comments
Post a Comment