Advertisement
Nairo05

Untitled

Jan 8th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. text = input("Text: ")
  2. tmp = []
  3.  
  4. def count(a):
  5.     text.count(a)
  6.  
  7. def delete(a):
  8.     help = ''
  9.     for i in range(len(text)):
  10.         if(text[i] != a):
  11.             tmp.append(text[i])
  12.     for i in range(len(tmp)):
  13.         help = help + tmp[i]
  14.     print(help)
  15.  
  16. def replace(a, withs):
  17.     help = ''
  18.     for i in range(len(text)):
  19.         if(text[i] == a):
  20.             tmp.append(withs)
  21.         else:
  22.             tmp.append(text[i])
  23.            
  24.     for i in range(len(tmp)):
  25.         help = help + tmp[i]
  26.     print(help)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement