I am having a hard time passing the username which I have prompted with input in my main function, into a string in the next function.
I have already built a function program which passes a pre determined name into the next functions string message. But now that I have tried to step it up and use the input method, I am having a hell of a time passing it into the string message in my next function.
def main():
someMessage = input("Enter your name:")
return someMessage
def buildGreeting (someMessage):
message = "Greetings " +input(someMessage)+ " you have been hacked! This message will self destruct in ten seconds!"
return message
def printMessage(aMessage):
print(aMessage)
if __name__ == '__main__':
main()
I want it to say "Greetings Leif, you have been hacked! This message will self destruct in ten seconds!"
This is my current result. It prompts for my name and then does nothing further. This is what it reads when I run the program.
Enter your name:Leif
Process finished with exit code 0