Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

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

Question

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

>> answer = \happy birthday\
>>

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

Explanation:

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()