Select the correct answerWhat will be the output of the following Python code?print("abc. DEF".capitalize())OptionsAbc. Defabc. defAbc. defABC. DEF
Question
Select the correct answerWhat will be the output of the following Python code?print("abc. DEF".capitalize())OptionsAbc. Defabc. defAbc. defABC. DEF
Solution
The correct answer is "Abc. def".
In Python, the capitalize() method converts the first character of a string to capital (uppercase) letter. If the string has its first character as capital, then it returns the original string. However, it doesn't change the case of the other characters in the string. So in this case, "abc. DEF" becomes "Abc. def".
Similar Questions
Select the correct answerWhat will be the output of the following Python code?print("code. TANTRA".capitalize())Optionscode. tantraCode. tantraAbc. DefCODE. TANTRA
lect the correct answerWhat will be the output of the following Python code?print("code TANTRA".capitalize())
Select the correct answerWhat will be the output of the following Python code?def cb(a): return a * a * a a = cb(3) print(a)Options330279
Select the correct answerAll keywords in Python are in _________OptionsUPPER CASENone of the mentionedCapitalizedlower case
Select the correct answerWhat will be the output of the following Python code?print('*', "abcde".center(6), '*', sep='')Options* abcde**abcde ** abcde ** abcde *
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.