Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question # 3 multiple choice what is the missing line of code? >>> answ…

Question

question # 3
multiple choice
what is the missing line of code?

>> answer = \happy birthday\
>>

happy birthday
answer.capitalize()
upper(answer)
capitalize(answer)
answer.upper()

Explanation:

Brief Explanations

In Python, the capitalize() method on a string object makes the first character of the string uppercase and the rest lowercase. Here, the initial string "happy birthday" needs to be changed to "Happy birthday", which is achieved by using the capitalize() method as an instance - method on the answer string object. The upper() method makes all characters in the string uppercase. The other non - instance - method capitalize and upper calls with the string as an argument are incorrect syntax in this context.

Answer:

A. answer.capitalize()