+ All Categories
Home > Education > Python programming lab16

Python programming lab16

Date post: 22-Jul-2015
Category:
Upload: profbnk
View: 146 times
Download: 3 times
Share this document with a friend
47
Python programming Lab 16
Transcript

Python programming

Lab 16

def censor(text, word):

list1 = text.split()

newlist = []

final_list = []

for w in list1:

if w == word:

newlist.append("*" * len(word))

else:

newlist.append(w)

final_list = " ".join(newlist)

return final_list


Recommended