-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring_test.py
More file actions
21 lines (16 loc) · 784 Bytes
/
string_test.py
File metadata and controls
21 lines (16 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
def main():
user_string=input('Enter a string: ')
print('This is what I found about that string:')
if user_string.isalnum():
print('String is alphanumeric.')
if user_string.isdigit():
print('The string contains only digits.')
if user_string.isalpha():
print('The string contains only alphabetic characters.')
if user_string.isspace():
print('The string contains only whitespace characters')
if user_string.islower():
print('The letters contains in the string are all lowercase')
if user_string.isupper():
print('The letters in the string are all uppercase.')
main()