I'm trying to figure out how to direct a function to a function. What I'm trying to do is answer a prompt question y/n that would run a certain function. When I input y, it will run through both functions instead of only function 1.
Thanks!
def company_type(question, public_company, private_company):
print("Is the target company public on NYSE or NASDAQ?")
prompt = f'{question} (y/n)'
ans = input(prompt)
if ans == 'y':
return (public_company)
if ans == 'n':
print("Please enter financial infomation manually.")
return (private_company)
company_type("public_company", "private_company", 1)
# function 1
def public_company():
return (print("Success 1"))
public_company()
# function 2
def private_company():
return (print("Success 2"))
private_company()