以下类方法定义正确的是()
A: class Student: fav=("唱歌","跳舞","绘画") def showFav(cls): for item in cls.fav: print(item)
B: class Student: fav=("唱歌","跳舞","绘画") @classmethod def showFav(cls): for item in fav: print(item)
C: class Student: fav=("唱歌","跳舞","绘画") @classmethod def showFav(cls): for item in cls.fav: print(item)
D: class Student: fav=("唱歌","跳舞","绘画") @classmethod def showFav(): for item in fav: print(item)
A: class Student: fav=("唱歌","跳舞","绘画") def showFav(cls): for item in cls.fav: print(item)
B: class Student: fav=("唱歌","跳舞","绘画") @classmethod def showFav(cls): for item in fav: print(item)
C: class Student: fav=("唱歌","跳舞","绘画") @classmethod def showFav(cls): for item in cls.fav: print(item)
D: class Student: fav=("唱歌","跳舞","绘画") @classmethod def showFav(): for item in fav: print(item)
举一反三
- 以下类方法定义正确的是() A: class Student: fav=("唱歌","跳舞","绘画") def showFav(cls): for item in cls.fav: print(item) B: class Student: fav=("唱歌","跳舞","绘画") @classmethod def showFav(cls): for item in fav: print(item) C: class Student: fav=("唱歌","跳舞","绘画") @classmethod def showFav(cls): for item in cls.fav: print(item) D: class Student: fav=("唱歌","跳舞","绘画") @classmethod def showFav(): for item in fav: print(item)
- 不够输出20个星号的语句是( )。知识点:字符串的复制 A: print("********************") B: print("*"*20) C: print(20*"*") D: print(20+"*")
- 下面那个程序代码是正确的_________ A: print("Programming is fun") print("Python is fun") B: print("Programming is fun")print("Python is fun") C: print("Programming is fun)print("Python is fun") D: print("Programming is fun)print("Python is fun")
- 在Student表中,将学生姓名为“王蒙”的学生改名为“王金山”,正确的SQL语句是___________。 A: UPDATE SET 姓名="王金山" IF 姓名="王蒙" B: UPDATE Student SET 姓名="王蒙"WHERE 姓名="王金山" C: UPDATE Student SET 姓名="王金山" WHERE 姓名="王蒙" D: UPDATE Student SET 姓名="王蒙" IF 姓名="王金山"
- 设变量a=15.69458能够输出: RMB15.69 的是()。 A: print("RMB{:.2f}".format(a)) B: print("RMB"+str(a)) C: print("RMB",a) D: print("RMB{}".format(a))