Skip to content

Commit 87622ad

Browse files
committed
Create 0012.py
1 parent 845a416 commit 87622ad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Liez-python-code/0012/0012.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def filtertext(x):
2+
with open(x, 'r') as f:
3+
text = f.read()
4+
userinput = input('myinput:')
5+
for i in text.split('\n'):
6+
if i in userinput:
7+
userinput = userinput.replace(str(i), '*'*len(i))
8+
print(userinput)
9+
10+
filtertext('word.txt')

0 commit comments

Comments
 (0)