#PCBTAM0000005. Chuỗi rỗng và chuỗi chứa khoảng trắng (Empty String versus Spaces)
Chuỗi rỗng và chuỗi chứa khoảng trắng (Empty String versus Spaces)
Empty String versus Spaces
Version: Phuoc Hung OJ Extended
Problem Statement
An empty string contains no characters, whereas a string containing one or more spaces is still nonempty. Given , report its length and its Boolean value in Python 3.
Only the zero-length string evaluates to False; every nonempty string evaluates to True.
Input
One line contains . The line may be empty or consist entirely of spaces.
Output
Print two lines: the character count, followed by True if is nonempty and False otherwise. Match the capitalization exactly.
Subtasks
- Subtask 1 (100 points): characters.
Examples
Example 1
Input
Output
0
False
Explanation. The empty string has length and Boolean value False.
Example 2
Input
Output
1
True
Explanation. A single space gives length , so the nonempty string evaluates to True.
Example 3
Input
A B
Output
3
True
Explanation. A B contains characters and is nonempty; output 3 and True.