-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring.py
More file actions
45 lines (36 loc) · 881 Bytes
/
Copy pathstring.py
File metadata and controls
45 lines (36 loc) · 881 Bytes
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
san = input("Enther the Words = ")
a = san.strip()
print(a)
e = san.center(45)
print(e)
print("uppercase : ", san.capitalize())
print("Lowercase : ", san.lower())
text = "Heloo world"
print("Title : ", text.istitle())
print("Swapcase : ", san.swapcase())
words = san.split()
count = 0
for word in words:
if word == "to":
count += 1
print("NO. Of to is : ", count)
print("encode : ", san.encode())
symbols = 0
for char in san:
if not char.isalnum() and char != ' ':
symbols += 1
print("Symbols = ", symbols)
if '@' in san:
print("Finding @ = True")
else:
print("Not Found")
keywords = ["email", "python"]
empty = ""
for word in words:
flagged = False
for keyword in keywords:
if keyword in word.lower():
word = "**" + word + "**"
break
empty += word + " "
print("Search = ", empty.strip())