Give the output of the following statements
>>> str='Hello World'
>>>str.istiltle()
Answers
Answered by
1
Corrected code:
str='Hello World'
print(str.istitle())
Output:
- True
Explanation:
- In Python, the istitle() method checks whether a sentence is in title case or not.
- In other words, it checks whether first letter of all words present in the string is in uppercase or not.
- Here, we can see that 'Hello' as well as 'World' both starts with uppercase letter. So, the method returns True.
Similar questions
English,
2 months ago
Science,
2 months ago
Computer Science,
2 months ago
English,
4 months ago
Science,
4 months ago
English,
11 months ago
Computer Science,
11 months ago
English,
11 months ago