question # 7\nmultiple choice\nwhat is the missing line of code?\n>>> answer = \happy birthday\\n>>>\nhappy…

question # 7\nmultiple choice\nwhat is the missing line of code?\n>>> answer = \happy birthday\\n>>>\nhappy birthday\no upper(answer)\no capitalize(answer)\no answer.upper()\no answer.capitalize()

question # 7\nmultiple choice\nwhat is the missing line of code?\n>>> answer = \happy birthday\\n>>>\nhappy birthday\no upper(answer)\no capitalize(answer)\no answer.upper()\no answer.capitalize()

Answer

Brief Explanations:

In Python, the capitalize() method on a string object makes the first character of the string uppercase and the rest lowercase. The upper() method makes all characters uppercase. The variable answer is a string, and to get the output 'Happy birthday' from "happy birthday", we use the capitalize() method as a method on the answer string object.

Answer:

D. answer.capitalize()