Answer: A) Hello world › capitalize() = FIRST char uppercase, rest lowercase › "hello world" goes "Hello world" (only 'h' capitalized) For beginners — don't confuse these: › .capitalize() = "Hello world" (first only) › .title() = "Hello World" (each word)
Stream, call, game, and work in even the most remote locations. Order online in minutes
The correct answer is B) Hello world. The capitalize() method in Python returns a copy of the string with its first character capitalized and the rest of the characters in lowercase. In the given code, the variable a is assigned the string "hello world".
B capitalize method make the first character have upper case and the rest lower case.
Can you beat the average IQ (98)? Take the test now and find out!
Start your journey in simulated trading with FTMO, backed by 10 years of experience.
B) Hello world. well: upper() means all uppercase(like, C) lower() means all lowercase capitalize() means very first letter of entire string.(like, B) title() means all first letter in the string.(like, A)
B. Hello world. The capitalize() method is used to appropriately capitalize a sentence as supposed just as we have in the English language whereby the first letter of a word or sentence starts with a capital letter. That's exactly what a.capitalize() did with the variable "a".
Alternative B. Will Upper case only the first character of the str, not each word in it (title).
United States Trends
- 1. #DWTS 43.9K posts
- 2. Northern Lights 18.9K posts
- 3. Justin Edwards 1,237 posts
- 4. #Aurora 4,015 posts
- 5. Andy 59.3K posts
- 6. Louisville 12.2K posts
- 7. Elaine 46.1K posts
- 8. #RHOSLC 5,184 posts
- 9. Robert 98.4K posts
- 10. Dylan 30.7K posts
- 11. #WWENXT 14.2K posts
- 12. Kentucky 22.4K posts
- 13. Lowe 11.7K posts
- 14. Whitney 8,619 posts
- 15. Alix 9,046 posts
- 16. Oweh 1,388 posts
- 17. Kam Williams N/A
- 18. #OlandriaxHarpersBazaar N/A
- 19. Jordan Walsh N/A
- 20. JT Toppin N/A
Something went wrong.
Something went wrong.