随笔分类 -  Python

摘要:最近在做Python的课程作业,遇到一个问题,描述如下: 使用Python内置的Tkinter模块进行GUI编程 给一个按钮(或菜单)绑定事件,打开一个新窗口,新窗口内有Entry若干,通过textvariable选项绑定变量,用于获取用户输入,但通过控制台输出(或方法参数传递)检查得知,程序获取到 阅读全文
posted @ 2019-11-19 20:41 槐城一只猫 阅读(4366) 评论(0) 推荐(3)
摘要:Reversing a List If you have time, you can try to write a function which will reverse a list recursively, according to thefollowing algorithm:1. rever 阅读全文
posted @ 2019-10-11 15:46 槐城一只猫 阅读(213) 评论(0) 推荐(0)
摘要:Programming 1.Analysing a Text File Look at the file xian_info.txt which is like this: First line is a country. Second line integer is a population. T 阅读全文
posted @ 2019-09-29 15:37 槐城一只猫 阅读(281) 评论(0) 推荐(0)
摘要:Programming Create a Class Student which should have the following information:Parameters passed to __init__ when an instance of the class is created: 阅读全文
posted @ 2019-09-29 15:14 槐城一只猫 阅读(403) 评论(0) 推荐(0)
摘要:#5.1 major = 'Software Engineering' print("Is major =='Software Engineering'? I predict True.") print(major=='Software Engineering') print("Is major =='Software Engineering'? I predict False.") print( 阅读全文
posted @ 2019-09-06 12:09 槐城一只猫 阅读(928) 评论(0) 推荐(0)
摘要:#4.1 pizzas = ['KFC','MDL','DKS'] '''1''' for pizza in pizzas: print(pizza); '''2''' for pizza in pizzas: print("I like "+ pizza +" pizza!") '''3''' print("My favourite pizza is K 阅读全文
posted @ 2019-09-06 11:17 槐城一只猫 阅读(1401) 评论(0) 推荐(0)
摘要:#3.1 names=['lpr','tjl','gnl','by','dqy']; print(names[0]); print(names[1]); print(names[2]); print(names[3]); print(names[4]); #3.2 print(names[0]+",Hello!"); print(names[1]+",Hello!"); print(names... 阅读全文
posted @ 2019-08-29 16:04 槐城一只猫 阅读(1021) 评论(0) 推荐(0)
摘要:#2.1 print("Hello world!"); #2.2 message="Hello,Python!"; print(message); #2.3 name="tian jiale"; print(name+",would you like to learn some Python today?"); #2.4 #小写 print(name.lower()+",would you lik 阅读全文
posted @ 2019-08-29 15:18 槐城一只猫 阅读(604) 评论(0) 推荐(0)