QUESTION IMAGE
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()
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.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
D. answer.capitalize()