1. """ Write a program which can compute the factorial of a given numbers. The results should be printed in a comma-separated sequence on a single line. Suppose the following input is supplied to the program: 8 Then, the output should be: 4…
第 0012 题: 敏感词文本文件 filtered_words.txt,里面的内容 和 0011题一样,当用户输入敏感词语,则用 星号 * 替换,例如当用户输入「北京是个好城市」,则变成「**是个好城市」. 把上一题的代码改一下就可以咯. Code: def filtertext(x): with open(x, 'r') as f: text = f.read() userinput = input('myinput:') for i in text.split('\n'): if i in…