Hi, I don’t understand why this doesn’t go through it seems fine?
def poem_title_card(poet, title):
return "The poem \"{}\" is written by {}".format(title, poet)
print(poem_title_card("Walt Whitman", "I Hear America Singing"))
Expected poem_title_card("Walt Whitman", "I Hear America Singing") to return "The poem "I Hear America Singing" is written by Walt Whitman." , but instead got "The poem "I Hear America Singing" is written by Walt Whitman" . Check your spelling and punctuation.
The curly braces (replacement field) serve a particular purpose where they take the name referencing an object and return a string formatted version of it (e.g the string character ‘3’ for an int object with the value of 3).
Hi everyone, I have done the impossible to see and understand the funcionality of the /. However, I decided to use single quote. But run it and it says Expected poem_title_card("I Hear America Singing", "Walt Whitman") to return "The poem "I Hear America Singing" is written by Walt Whitman." , but instead got "The poem "I Hear America Singing" is written by Walt Whitman" . Check your spelling and punctuation.
here is what I am doing, can someone please help me
BTW: I had to post this on someones else question as I did not find the way to post a new one, I meant I did not have enough timeto search how to do it.
def poem_title_card (title,poet):
return ‘The poem “{}” is written by {}’.format(title, poet)
print(poem_title_card(“I Hear America Singing”, “Walt Whitman.”))
Typically triple quotation marks denote multi-line comments as such:
def function(arr):
"""
this function intends to concatenate a list of strings into a space-separated string
Arguments: arr
"""
return " ".join(arr)
Each syntax serves a specific purpose and although the code works fine, that does not mean one should confuse the developer, debugger or client by using the wrong tools to achieve the desired purpose !
Check your punctuation of the output string. Also, check the arguments supplied to the function and refer to examples (make sure the same examples are used).
def poem_title_card(title, poet):
return 'The poem "{}" is written by {}.'.format(title, poet)
title = "I Hear America Singing"
poet = "Walt Whitman"
print(poem_title_card(title, poet))