Hello,
Can someone explain why the following code includes the "display" variable in the function?
Couldn't you just use
Can someone explain why the following code includes the "display" variable in the function?
def full_name(first, middle, last, display):
name = first + " " + middle + " " + last
if display:
print(name)
return nameto call function:full_name("John", "W", "Doe", True)
complete_name = full_name("John", "W", "Doe", False)
print(complete_name)Also, is it necessary to use the complete_name line of code?Couldn't you just use
print(full_name("John", "W", "Doe")
buran write May-25-2025, 05:22 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
