forked from easyawslearn/Python-Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-string-validating.py
More file actions
47 lines (38 loc) · 1.12 KB
/
python-string-validating.py
File metadata and controls
47 lines (38 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#######################################
####### Pyhton String validating Example
#######################################
example="python"
print("String validating for lowercase")
print(example.islower())
# String validating for lowercase
# True
example="python"
print("String validating for Upper case")
print(example.isupper())
# String validating for Upper case
# False
example="Python Example"
print("String validating for Title case")
print(example.istitle())
# String validating for Title case
# True
example=" "
print("String validating for is having only space")
print(example.isspace())
# String validating for is having only space
# True
example="123asd"
print("String validating for is having alphanumeric")
print(example.isalnum())
# String validating for is having alphanumeric
# True
example="123asd"
print("String validating for is having alphabets")
print(example.isalpha())
# String validating for is having alphabets
# False
example="123"
print("String validating for is having onlyu digits")
print(example.isdigit())
# String validating for is having onlyu digits
# True