You are on page 1of 4

a=input("enter your text")

# type​1 for finding a word.


#2 for counting number of sentence.
#3 for counting number of words.
#4 for replacing a word.
#5 for space after full stops and new line starting with caps.
#6 for converting whole text in lower case.
#7 for converting whole string in uppercase.
#8 for adding header.
#9 for adding number as bullet(point wise).
#10 for adding different type of bullets.

aa=int(input("what do you want")


def find():
b=input("enter word you want to find")
if b in a:
print("the word is present")
else:
print("Absent")

def count():
b=a.split(".")
print(len(b)-1)

def count1():
b=a.split()
print(len(b)+1)

def replace():
b=input("which word you want to replace")
c=input('what you want in its place')
if b in a:
print(a.replace(b,c))
def dot_caps():
b=a.split('.')
print(b)
c=''
for i in b:
if (ord (i[0])>=97 and ord(i[0])<=122):
c=c+chr(ord(i[0])-32)
else:

c=c+i[1:]+'. '
print(c)

def lower_case():
b=''
for i in a:
if (ord(i)==32):
b=b+' '
elif (ord(i)>64 and ord(i)<=90):
b=b+chr(ord(i)+32)
else:
b=b+i

print(b)

lower_case()

def upper_case():
b=''
for i in a:
if (ord(i)==32):
b=b+' '
elif (ord(i)>96 and ord(i)<=122):
b=b+chr(ord(i)-32)
else:
b=b+i
print(b)

upper_case​()

def header():
b=input("heading")
c=int(input("no. of spaces"))
print(" "*c+b)
print(a)

header()

def point_num():
b=a.split(". ")
for i in range(-1,len(b)-1):
if i==len(b)-2:
print(i+2,b[i+1],sep=".")
else:
print(i+2,b[i+1]," ",sep=".")

def bullets():
c=int(input("type 1 for #,type 2 for:,type 3 for.,type 4 for*,type 5 for->,type 6 for=>"))
b=a.split(".")
for i in range(0,len(b)+1):
if(c==1):
print("# "+b[i]+".",sep='')
elif(c==2):
print(": "+b[i]+".",sep='')
elif(c==3):
print(". "+b[i]+".",sep='')
elif(c==4):
print("* "+b[i]+".",sep='')
elif(c==5):
print("-> "+b[i]+".",sep='')
elif(c==6):
print("=> "+b[i]+".",sep='')
else:
print("put right choice")

point_num()
if (aa==1):
find()
elif(aa==2):
count()
elif(aa==3):
count1()
elif(aa==4):
replace()
elif(aa==5):
dot_caps()
elif(aa==6):
lower_case()
elif(aa==7):
upper_case()
elif(aa==8):
header()
elif(aa==9):
point_num()
elif(aa==10):
bullets()

You might also like