摘要: We can use # comment to coment a row or several rows still we can use a more effecient way to comment multiple lines '''start ... ... end''' where the 阅读全文
posted @ 2016-06-05 12:25 Symmetry 阅读(420) 评论(0) 推荐(0)
摘要: We can store strings in variable as a list of charactersvar = "this is a string" we can refer part of the string by print(var[0:5]) 阅读全文
posted @ 2016-06-05 12:19 Symmetry 阅读(749) 评论(0) 推荐(0)
摘要: A dictionary contains 1 to 1 mapping. dict = {"key1":"value1", "key2":"value2"} then we can simply refer the key to call corresponding value var = dic 阅读全文
posted @ 2016-06-05 11:53 Symmetry 阅读(158) 评论(0) 推荐(0)
摘要: A tuple is similar to list but can not be modified tuple1 = (1,) tuple2 = (1,2,3,4) to refer elemetn in a tuple var1 = tuple[0] var2 = tuple[-1] just 阅读全文
posted @ 2016-06-05 11:45 Symmetry 阅读(121) 评论(0) 推荐(0)
摘要: To plot chart we firstly should import numpy as npimport matplotlib.pyplot as plt then we can use plt.plot(x) plt.show() plt.savefig("figname.format", 阅读全文
posted @ 2016-06-05 11:33 Symmetry 阅读(208) 评论(0) 推荐(0)
摘要: List is similar to array but beyond. A list can contial various types of data. list=["string", 1223, 2.718] to refer an element from a list, we can us 阅读全文
posted @ 2016-06-05 11:21 Symmetry 阅读(150) 评论(0) 推荐(0)
摘要: Function is a code block can repeatedly called to accomplish a process. def function_name(para1,para2,...) code reture value use return can pass the r 阅读全文
posted @ 2016-06-05 11:11 Symmetry 阅读(184) 评论(0) 推荐(0)
摘要: If we do not know exactly how many times the loop will circle, but we do know the condition keeping the loop circlling, we can use: while condition: a 阅读全文
posted @ 2016-06-05 10:53 Symmetry 阅读(126) 评论(0) 推荐(0)
摘要: IndentationError: expected an indented block 有冒号的下一行往往要缩进 阅读全文
posted @ 2016-06-05 10:43 Symmetry 阅读(104) 评论(0) 推荐(0)