Python 英语练习程序 - 第一版
已经开始自学Python快一个月了,网上教程好多坑爹,残缺不全乱拼凑,目前已更换4次视频教程。
没办法,面授课程1W以上的,要用18~100元来学肯定有代价,所以有这些教程已经很感激,很满足了。
由于学Python触及很多英语,而且真要打算深入学习掌握英语应该是必然的,所以先涉及Python方面的英文单词开始着手,目前已掌握113个单词,每天增加,希望能坚持。
所以今天想用已目前掌握的知识,能否写写练习英文的程序,还真没想到想出来一个超级low的程序。
虽然现在有很多新奇猎奇的英语培训方式(估计也很赞),但普遍应该都是从单词入手,所以尝试学英语的朋友们,都应该有这样的感触。
一个单词记手机或电脑上,时间的累计下,单词量增大,所以每天回看前些天单词,居然还能记得,让人很欣慰,但是把这些记录的单词顺序打乱就蒙了。
这是因为人脑的记忆是根据相片式的静态场景而回忆,所以当你打乱顺序,你脑海中的那个单词对应的相片已经不在了,所以我今天写的这个程序和简单,就是把你平时学习而记录下来的单词,以字典形式保存,等你回查单词时把顺序打乱后呈现在你面前,而且右面显示的翻译先用字体和背景颜色相同来覆盖,实在想不起来就用拖住鼠标来查看翻译,每次限时5个单词
1 import random 2 3 word = {"avail": ["效益", "可用的"], "intersection": ["交叉"], 4 "authentication": ["认证"], "calendar": ["日历"], "union": ["同盟", "并行"], 5 "opration": ["操作"], "modify": ["修改"], "disjoint ": ["不相交", "脱节"], 6 "incident": ["事件"], "permission": ["权限"], "minor": ["未成年"], "adult": ["成年"], 7 "variable": ["变量"], "planish": ["打平"], "extend": ["扩展"], "average ": ["平均"], "result": ["结果"], 8 "parameter": ["参数"], "argument": ["实参"], "statistics": ["统计"], "expected": ["预期"], "callable": ["调用"], 9 "lyric": ["歌词"], "attribute": ["属性"], "gravity": ["严重"], "method": ["方法"], "intorduce": ["介绍"], 10 "init": ["初始化"], "static": ["静态"], "private": ["私人的", "私有"], "inherit": ["继承"], "exception": ["例外"], 11 "element": ["元素"], "bullet": ["子弹"], "enemy": ["敌人"], "cartridge clip": ["弹夹"], "record": ["记录"], 12 "capacity": ["容量"], "Damage": ["损坏"], "practise": ["练习"], "templet": ["模板"], "nonsense": ["荒唐"], 13 "property": ["特性", "财产"], "constructor": ["构造器"], "iterable": ["可迭代的"], "iterator": ["迭代器"], 14 "generator": ["生成器", "创造者"], "collections": ["收藏"], "instance": ["例子", "实例"], "yield": ["屈服", "让路"], 15 "closure": ["关闭"], 16 "required": ["必须的"], "decorator": ["装饰器"], "wrapped": ["打包"], "slots": ["槽"], "detected": ["检测到"], 17 "interception": ["拦截"], "filter": ["过滤"], "sequence": ["序列"], "debug": ["调试"], "multitasking": ["多任务处理"], 18 "processing": ["进程"], "interval": ["间隔"], "apply": ["应用", "申请"], "queue": ["排队"], "thread": ["线程"], 19 "acquire": ["获得"], "release": ["释放"], "current": ["现在的"], "socket": ["套接字"], "receive": ["接收"], 20 "bind": ["捆绑"], "transmission": ["传输"], "source": ["来源"], "destination": ["目的地"], "protocol": ["协议"], 21 "account": ["账户"], 22 "failure": ["失败"], "status": ["状态"], "primary": ["主要的"], "partition": ["分区"], "cylinder": ["圆柱体", "柱面(硬盘)"], 23 "select": ["选择"], "alter": ["改变"], "available": ["可得到的"], "boundary": ["边界"], "query": ["疑问"], 24 "force": ["强制"], "depend": ["依赖"], "spencify": ["详细说明"], "desired": ["期望"], "custom": ["定制"], 25 "accept": ["接受"], "export": ["输出"], "general": ["常规"], "length": ["长度"], "decimal": ["十进制"], 26 "strip": ["除去"], "identifier": ["标识符"], "foundation": ["基础", "根基"], "reverse": ["反转"], "assignment": ["分配"], 27 "shallow": ["浅的"], "enumerate": ["列举"], "exam": ["考试"], "merchandise": ["商品"], "indices": ["索引"], 28 "slices": ["切片"] 29 , "salary": ["工资"], "subscript": ["下标"], "bill": ["结算"], "confirm": ["确认"], "distance": ["距离"]} 30 31 word_li = [] 32 word_li2 = [] 33 for i in word: 34 word_li.append(i) 35 36 for x, v in word.items(): 37 word_li2.append((x, v)) 38 # a = \033[1;36;46m test \033[0m 39 40 a, b, c, d, e = random.sample(range(0, len(word_li2)),5) 41 42 43 print(word_li2[a][0].ljust(15," ") + "\t".expandtabs(10) + "\033[1;36;46m" + str(word_li2[a][1]).center(20," ") + "\033[0m" + "\n" + 44 word_li2[b][0].ljust(15," ") + "\t".expandtabs(10) + "\033[1;36;46m" + str(word_li2[b][1]).center(20," ") + "\033[0m" + "\n" + 45 word_li2[c][0].ljust(15," ") + "\t".expandtabs(10) + "\033[1;36;46m" + str(word_li2[c][1]).center(20," ") + "\033[0m" + "\n" + 46 word_li2[d][0].ljust(15," ") + "\t".expandtabs(10) + "\033[1;36;46m" + str(word_li2[d][1]).center(20," ") + "\033[0m" + "\n" + 47 word_li2[e][0].ljust(15," ") + "\t".expandtabs(10) + "\033[1;36;46m" + str(word_li2[e][1]).center(20," ") + "\033[0m")

浙公网安备 33010602011771号