Nov-15-2020, 08:13 PM
Hi
I am trying one of the HackerRank challenges.
I have the following code in Python as part of a problem. What I need to do is have an output that says "Hello <firstname> <lastname>! You have just delved into Python"
Code:
So I could write:
I am trying one of the HackerRank challenges.
I have the following code in Python as part of a problem. What I need to do is have an output that says "Hello <firstname> <lastname>! You have just delved into Python"
Code:
def print_full_name(a, b): if __name__ == '__main__': first_name = input() last_name = input() print_full_name(first_name, last_name)So my understanding is that there is a function called print_full_name that is called in the second chunk of code. Prior to the function, the code asks for input; first_name and last_name
So I could write:
print(f'Hello {first_name} {last_name}! You just delved into python.')Which seems to work. What I don't understand is how a and b get into the picture. How does a and b relate to first_name and last_name? Because the code also works if I try the below
print(f'Hello {a} {b}! You just delved into python.')