首页/下载资源/行业研究/python(5).zip

ZIPpython(5).zip

2402_8572708513.77KB需要积分:1

资源文件列表:

python(5).zip 大约有47个文件
  1. python/n的阶乘.py 197B
  2. python/读取轨迹文件实现turtle绘图.py 745B
  3. python/分别统计输入中字母・数字的个数.py 219B
  4. python/各位数字和.py 106B
  5. python/工资.py 286B
  6. python/换钱的交易.py 90B
  7. python/回文判断.py 281B
  8. python/回文数.py 347B
  9. python/绘制彩色标靶盘.py 450B
  10. python/基于turtle库自定义绘制圆形函数来绘制同心彩色圆形.py 465B
  11. python/计算Π值(迭代N次).py 266B
  12. python/计算年龄.py 820B
  13. python/计算平均值.py 120B
  14. python/加密文件(文件版).py 1.18KB
  15. python/简易计算器.py 886B
  16. python/利用turtle绘制六角星.py 589B
  17. python/列表基本操作.py 404B
  18. python/列表求和.py 83B
  19. python/列表转字典.py 222B
  20. python/蟒蛇.py 363B
  21. python/判断素数.py 158B
  22. python/前驱后续字符.py 98B
  23. python/求三角形面积.py 124B
  24. python/求水仙花数.py 139B
  25. python/人民币兑换.py 216B
  26. python/日期天数转换.py 615B
  27. python/删除重复字符.py 102B
  28. python/摄氏华氏温度转换.py 63B
  29. python/生兔子问题(递归思想).py 297B
  30. python/时钟指针.py 695B
  31. python/世界你好.py 22B
  32. python/输出下一秒.py 570B
  33. python/数值翻转.py 190B
  34. python/数字排序.py 387B
  35. python/说句心里话.py 45B
  36. python/素数判断(非函数版).py 116B
  37. python/天天向上的力量.py 102B
  38. python/统计文件中单词・字符数.py 709B
  39. python/伪随机数.py 383B
  40. python/文件复制.py 164B
  41. python/英文诗歌统计.py 485B
  42. python/找最大最小整数.py 87B
  43. python/整数各位数字求和 (1).py 58B
  44. python/整数合并(非函数版).py 58B
  45. python/自动生成列表.py 159B
  46. python/字符串合并与拆分.py 77B
  47. python/字符串偶数位置截取输出.py 67B

资源介绍:

python(5).zip
def build_cipher_map(key): """构建加密字母映射表""" alphabet = 'abcdefghijklmnopqrstuvwxyz' unique_key = "" for char in key: if char not in unique_key: unique_key += char reverse_alphabet = ''.join([char for char in alphabet[::-1] if char not in unique_key]) cipher = unique_key + reverse_alphabet cipher_map = {} for i in range(len(alphabet)): cipher_map[alphabet[i]] = cipher[i] return cipher_map def encrypt_file(input_filename, output_filename, cipher_map): """加密文件内容并写入新文件""" with open(input_filename, 'r', encoding='utf-8') as infile: content = infile.read() encrypted_content = "" for char in content: if char in cipher_map: encrypted_content += cipher_map[char] else: encrypted_content += char with open(output_filename, 'w', encoding='utf-8') as outfile: outfile.write(encrypted_content) def main(): key = input(" ") cipher_map = build_cipher_map(key) encrypt_file('encrypt.txt', 'output.txt', cipher_map) print("") if __name__ == "__main__": main()
100+评论
captcha