![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
Daria·Saira
这个作者很懒,什么都没留下…
展开
-
190404_Py_example6 (the area of a circle)
Python_example 6program_1 calculate the area of a circlemethod_1_principle method_2_principleconclusion :1.math method compare to computer mind2.use func perf_counter to analyze the code’...原创 2019-04-04 15:24:38 · 216 阅读 · 0 评论 -
Python_file_test7_190616
conclusionjoin : join() 方法用于将序列中的元素以指定的字符连接生成一个新的字符串。str.join(sequence)#coding:utf-8f=open("C:/Users/UMR/Desktop/123.txt","rt")lines=f.readlines()#test find read with the space ('\n')lines...原创 2019-06-15 21:30:36 · 159 阅读 · 0 评论 -
Python_Combined data type_practice190603
思路:暂存当前最大词(为比较字符串大小)及其频率(为比较频率)先比较频率,仅当频率相同时比较字符串大小#coding:utf-8#printice 3 data cleaning and frequency statistics '''输出长度大于2且最多的单词。...原创 2019-06-03 20:57:41 · 317 阅读 · 0 评论 -
Python_File and data formatting_practice190614
conclusionformat : read the code for detailsrange()#range(start, stop[, step])print(range(5))print(list(range(0, 5)))print(list(range(3, 10)))print(list(range(3, 10,2)))print(list(range(3, 1...原创 2019-06-14 17:02:41 · 129 阅读 · 0 评论 -
Python_something/just for fun
list indices must be integers or slices, not str列表索引 必须是 整数 或 切片,而不是straha ! eval()space for eval() official codeinp2=input()print("just out put the input:\n",inp2)print("and this is type of...原创 2019-05-19 14:39:29 · 240 阅读 · 0 评论 -
Windows环境安装Matplotlib等package的问题及解决办法
background : 要用word cloud0x01 安装word clouderror : 依赖两个packagenumpy 手动安装pip自动安装第二个依赖包成功安装word cloud0x02 使用时调用Matplotlib --> error0x03 安装Matplotlib --> learn error : lack of dependen...原创 2019-05-08 17:42:04 · 446 阅读 · 0 评论 -
Python_190414_test5
Python_190414_test5program1#计算任意个输入数字的乘积def cmul(*a):#notice the use of changeable value s=1 for i in a: s*=i return s #notice the space signs the layer of the program prin...原创 2019-04-14 19:27:44 · 1161 阅读 · 0 评论 -
Py_190417_example_5
get the changeable inputs#prog1 example_5#func 1 get inputdef getinput(): nums=[]#define a viod list iput=input("please input numbers (enter for exit):")#for the firstinput while i...原创 2019-04-17 13:15:08 · 105 阅读 · 0 评论 -
Function_Pynote_190408
Functiondefinition and comprehensionkey point :组合数据类型在python中以指针实现;因此若函数未定义真实的组合数据类型 (local variable) 则使用指针指向 外部 global variable; in practice alters the pointer means alters the global variable...原创 2019-04-08 16:57:14 · 82 阅读 · 0 评论 -
190405_Py_practice_FOR_cycle
something interesting with ‘For cycle’ in pythonkey point : for_cycle & break & else#求100以内所有素数之和并输出。 ...原创 2019-04-05 12:50:41 · 65 阅读 · 0 评论 -
190404_py_practice_skill
#prog4#"水仙花数"是指一个三位整数,其各位数字的3次方和等于该数本身。#例如:ABC是一个"3位水仙花数",则:A的3次方+B的3次方+C的3次方 = ABC。...原创 2019-04-04 17:23:21 · 76 阅读 · 0 评论 -
Python_test8_Robust input_190617
conclusioncomplex()和complex(eval())之间的比较将能够排除非数字类型的输入。注意:不能直接使用eval(),否则,用户可以通过输入表达式(如100**2)输入数字,与要求不同(在实际应用中带来安全隐患)。高危函数eval()try - except / assert#coding:utf-8'''program2.数字的鲁棒输入--------...原创 2019-06-17 18:53:00 · 188 阅读 · 1 评论