-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString.py
More file actions
25 lines (20 loc) · 778 Bytes
/
Copy pathString.py
File metadata and controls
25 lines (20 loc) · 778 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
a = "Recently, topic has/have sparked a heated debate among individuals. There is a school of thought that many mankind believe that it is a important topic"
# 1. How to find string length
print("String length",len(a))
print("------------------------")
# 2. How many times alphabet (e) is occurring
print("alphabet (e) is occurring",a.count("o"))
print("------------------------")
# 3. Convert to uppercase and Lowercase
print("** lower Case **")
print(a.lower())
print("** Upper Case **")
print(a.upper())
print("------------------------")
# 4. Covert the following string into a title
print("Convert to string into a title")
print(a.title())
print("------------------------")
# 5. find the index number of "fit in".
print("Find index number")
print(a.find("individuals"))