
python3基础
IDIOThh
这个作者很懒,什么都没留下…
展开
-
Python3-模块调用示例(从一个文件夹中调用另外一个文件夹中的类)
1、文件夹的布局 2、调用流程modal中的 new_cound.py 继承modal中count中A类test文件夹中counttest.py调用new_cound中的B类 代码如下:count.pyclass A(): def __init__(self,a,b): self.a = int(a) self.b ...原创 2018-09-13 14:54:31 · 12460 阅读 · 1 评论 -
python基础1
一、print打印使用1、打印字符串,print("")>>print("hello 2018")hello 2018常见的占位符有:占位符 替换内容 %d 整数 %f 浮点数 %s 字符串 %x 十六进制整数如果只是想显示2位小数点数值,则可以这样子 s1 = 72 s2 = 85 r = (s2-s1)/s1 print('成绩提升了:%.2f%%'%r)...原创 2018-09-23 16:28:01 · 614 阅读 · 0 评论