I want my code to ask the user for his first and last name and print it out. If the input should be empty, a different message should be printed.
def printName(first="", last=""):
print( "{} {}".format(first, last) )
first = input(("Please type your first name: "))
last = input(("Please type your last name: "))
printName( )
This is my current code but it doesnt print out anything I input.
>Solution :
You have forgotten to pass the parameters to the function:
def printName(first="", last=""):
print( "{} {}".format(first, last) )
first = input(("Please type your first name: "))
last = input(("Please type your last name: "))
printName(first, last)