设为首页收藏本站
开启辅助访问

python字符串翻转教学设计

您所在的位置:网站首页 编写程序输出一首诗 python字符串翻转教学设计

python字符串翻转教学设计

2024-07-10 06:14| 来源: 网络整理| 查看: 265

7.2 摩斯密码(project)(已更新)

Spring__ing: def morse_code_decryption(txt): """接收密文字符串为参数,返回用摩斯密码解密后的字符串。""" char = 'abcdefghijklmnopqrstuvwxyz' + '0123456789' + '.:,;?=\'/!-_"()$&@ ' morse_letter = [".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."] morse_digit = ['-----', '.----', '..---', '...--', '....-', '.....', '-....', '--...', '---..', '----.'] morse_spec = ['.-.-.-', '---...', '--..--', '-.-.-.', '..- -..', '-...-', '.----.', '-..-.', '-.-.--', '-....-', '..--.-', '.-..-.', '-.--.', '-.--.-', '...-..-', '·-···', '.--.-.', ''] # 补充你的代码 con=morse_letter+morse_digit+ morse_spec txt=txt.replace(' ',' ~ ') ls=txt.split() ls2=[] for i in ls: if i in con: ls2.append(char[con.index(i)]) else: ls2.append(i) str=''.join(ls2) return str.replace('~',' ')

Python第九章作业(初级)

2401_84721123: 为什么我输不出来

7.1 大学排行榜分析(project)

lanshi17: 博主你好 请问有没有附件 txt 文档呀?

HTML2023新年源代码(炫酷动态烟花)

TLHHH0: 我根本打不开

Python第五章作业

2401_84835095: 第13关不对



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3