Can you please help!

Hi,

I guessed on this answer and got it right. Can you please help me understand it?

In this “print”: print(“Extraordinary” + exclamation_sign)
I think I get that it doesn’t print b/c the exclamation_sign is in the function so to print “Extraordinary!” one should indent the print so that it aligns with “return”, right?

and with:

print(append_exclamation(“wow”))

How come this print needs double (()) while the "(“Extraordinary” + exclamation_sign) only needs one?

Any insight to help me understand would be greatly appreciated!

Thank you very much!
Josh

1 Like
print(“Extraordinary” + exclamation_sign)
#assumes some variable exclamation_sign (not a function)

exclamation_sign = "!"
print(“Extraordinary” + exclamation_sign)
#outputs>>> Extraordinary!
#note: exclamation_sign must be of type string
# to be able to concatenate it (+) with another string
print(append_exclamation(“wow”))
# implies that there is a function named append_exclamation(input)
# that takes a string input and appends a "!" at the end of it
word = "wow"
append_exclamation(word)
print(word)
outputs>>> wow!
1 Like

Thank you very much toastedpitabread!