py
II. Les jeunes
这个作者很懒,什么都没留下…
展开
-
shangji
f=open(‘sample.tex’,‘a+’) g=‘文本文件读取方法\n文本文件的写入方\n’`` with open(‘sample.txt’,‘a+’)as f: f.write(g) 19 欢迎使用Markdown编辑器 你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。 新的改变 我们对Markdown编辑器进行了一些功能拓展与语法支持,除了标准的Markdown编辑器功原创 2020-06-08 14:40:07 · 132 阅读 · 0 评论 -
上机10.2.py
class Root: __total=0 def init(self,v): self. __value=v Root. __total+=1 def show(self): print(‘self.__value:’,self. __value) print(‘Root.__total:’,Root. __total) @ classmethod def classShowTotal(cls): print(cls. __total) @staticmethod def staticShowTotal(原创 2020-06-01 20:47:17 · 102 阅读 · 0 评论 -
python上机实验
import types class Demo: pass t=Demo() def test(self,v): self.value=v t.test=test t.test t.test(t,3) print(t.value) t.test=types.MethodType(test,t) t.test t.test(5) print(t.value) 欢迎使用Markdown编辑器 你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细原创 2020-06-01 19:59:05 · 293 阅读 · 0 评论 -
python
class Car: price=100000 def_init_(self,c): self.color=c car1=Car("red") car2=Car("blue") print(car1.color,Car.price) Car.price=110000 Car.name='QQ' car1.color="Yellow" print(car2.color,Car.price,Car.name) print(car1.color,Car.price,Car.name).原创 2020-06-01 14:41:03 · 133 阅读 · 0 评论