- 博客(6)
- 收藏
- 关注
原创 面向对象进阶_课后练习
class Car: def __init__(self,motor,chassis,seat,shell): self.motor = motor self.chassis =chassis self.seat =seat self.shell =shell def run(self): print(...
2020-01-13 20:44:10 230
原创 多态实例
class Man: def eat(self): print("饿了,吃饭!")class Chinese(Man): def eat(self): print('用筷子吃饭')class English(Man): def eat(self): print('用刀叉吃饭')class Indian(Man): ...
2020-01-11 13:04:49 178
原创 小练习
判断一个输入的数,是否是素数num = int(input('输入一个数字:'))list=[]for i in range(2,num-1): list.append(num%i)if 0 in list: print('不是素数')else:print('是素数')...
2020-01-10 11:27:33 167
原创 学习类与对象
这个东哥讲的真好!https://www.bilibili.com/video/av26478927class Cat: #属性 #当创建玩一个对象后,立马会自动调用 def __init__(self,newColor,newWeiba,newWeight): self.color = newColor self.weiba = new...
2020-01-09 22:09:11 106
原创 小练习,简单的录入系统V1.0
思路还是不清晰,很多重复代码,应该可以使用def。#获取要操作的数字names= ['111','222','333','444','555','666',]while True:#打印提示 print('*'*30) print('欢迎使用系统!') print('1:添加名字') print('2:删除名字') print('3:修改名字') ...
2020-01-09 17:16:39 211
原创 python课后练习(高琪400集第一季.第五章)
新手第7天记录输入3245,输出5432直接反向输出def sort_num(n): n1 = str(n) n2 = n1[::-1] print(n2)sort_num(3245)按大小顺数排列def sort_num(n): m = [] n2=str(n) for i in n2: m.append(i) m.sort...
2020-01-07 13:55:16 960 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人