计算原理课程笔记(一)
来源:互联网 发布:js给div设置 编辑:程序博客网 时间:2024/05/21 06:34
计算原理课程笔记(一)
<python>"""This is a docstring for the module:This module demonstrates the use of docstrings."""def repeat_string(string, num): """ This is a docstring for a function: Return a new string that repeats the input string num times. """ newstring = "" for dummy_loop_counter in range(num): newstring += string return newstringclass SimpleCounter: """ This is a docstring for a class: Simple counter class that can only increment. """ def __init__(self, initial_val = 0): self._val = initial_val def increment(self): """ This is a docstring for a method: Increment counter. """ self._val += 1 def get_value(self): """ This is a docstring for another method: Return current value of the counter. """ return self._val<python>
<python>import poc_helper_stuff as providedimport poc_mancala_testsuitepoc_mancala_testsuite.run_suite(SolitaireMancala)import poc_mancala_guipoc_mancala_gui.run_gui(SolitaireMancala())<python>
导入poc_helper_stuff 模块
导入测试模块
导入gui模块
<python>def __init__(self, initial_balance): """Creates an account with the given balance.""" self.banlance=initial_balance self.fees=0<python>
self.banlance
表示实例的变量
<python>lst+=[lst[-3]+lst[-2]+lst[-1]]<python>
[]
转化lst[-3]+lst[-2]+lst[-1]
为列表
0 0
- 计算原理课程笔记(一)
- 计算语言学课程笔记(一)
- 模式识别课程笔记(一)
- 计算机网络课程笔记(一)
- 计算语言学课程笔记(二)
- 计算语言学课程笔记(三)
- 数据库原理(一)--数据库课程导入
- GeekBand-极客班-C++算法原理与实践-董飞-课程笔记(一)
- C语言课程笔记(一)
- 《时间管理》课程笔记(一)
- 《经济学百年》课程笔记(一) 导论
- Mining Massive Datasets课程笔记(一)
- python 慕课课程笔记(一)
- Udacity自动驾驶课程笔记(一)
- Python基础课程笔记(一)
- MIT 6.00 导论课程笔记(一)
- Java学习:coursera课程笔记(一)
- 大学操作系统原理课程笔记
- MD5加密
- JSP生命周期 ,Servlet生命周期
- Meta 标签 apple-mobile-web-app-
- 常用多媒体文件格式
- java微信开发引入jssdk一直报invalid url domain错的其他原因
- 计算原理课程笔记(一)
- Java学习笔记之多态
- orcale数据库常用查询语句
- 第十四周阅读程序(3)
- PAT 1021 Deepest Root (25) (并查集+DFS)
- 禁止 Httpclient4.3 自动跳转
- HDU 4424 并查集
- 虚拟机开机,无法打开内核设备“\\.\Global\vmx86”: 系统找不到指定的文件
- ZeroClipBorad做按钮复制的问题,在jquery_usayui中的dialog弹窗中使用 只有第一个点开的页面有效,关闭该弹窗再次打开失效!!!