QUESTION IMAGE
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()
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.
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
A. answer.capitalize()