1.python是什么语言? Python是一种支持面向对象的解释性高级语言,属于脚本语言的一种. 2.IDLE是什么? IDLE是开发python程序的基本IDE(集成开发环境),具备基本的IDE的功能,是非商业Python开发的不错的选择. 3.print()的作用是什么? print()方法用于打印输出 4.python中表示乘法的符号是什么? * 5.为什么print("i love you" + 5)不可以执行会报错,而print("i love you"
1. sum=0 a=input() for i in a: sum=sum+int(i)**3 if sum==int(a): print('水仙数') 2. lst=[100,2,6,9,1,10,12,35,1,9,65,8,100,0,1,9,5,6]count=0while count<len(lst): for i in range(0, len(lst) - 1): if lst[i] > lst[i + 1]: lst[i ], lst[i+1] = lst[i+1], lst
1. count=1 while count<11: fen=input('请第{}个评委打分' .format( count)) if int(fen) >5 and int(fen) <10: print("评分有效") else: continue count+=1 2. lst=['西游记','水浒传','红楼梦','笑傲江湖'] dic={} for i in lst: fen=int(input("给{}打分:".format(i)))
多重继承 继承是面向对象编程的一个重要的方式,因为通过继承,子类就可以扩展父类的功能. 哺乳类:能跑的哺乳类,能飞的哺乳类: 鸟类:能跑的鸟类,能飞的鸟类. class Animal(object): pass class Bird(Animal): pass class Dog(Mammal): pass class Runnable(object): def run(self): print('Running...') class Dog(Mammal, Runnable): pass 通过