Student是一个学生类,其构造函数的声明为def __init__(self, name, score),对Student类进行实例化生成对象stu1,正确的是
A: stu1 = Student('xiaoming',89)
B: stu1 = Student(stu1,'xiaoming',89)
C: xiaoming = Student(stu1,89)
D: stu1 = Student(89,'xiaoming')
A: stu1 = Student('xiaoming',89)
B: stu1 = Student(stu1,'xiaoming',89)
C: xiaoming = Student(stu1,89)
D: stu1 = Student(89,'xiaoming')
举一反三
- class Student:def __init__(self,name):self.name=namedef (1)(self):print(self.name)if __name__=='__main__':stu1=Student('Li Xiaoming')stu2=Student('Ma Hong')stu3=(2)del stu2del stu1完成(1)和(2)代码填写,使之输出如下结果:Li XiaomingMa Hong
- 中国大学MOOC: Student是一个学生类,其构造函数的声明为def __init__(self, name, score),对Student类进行实例化生成对象stu1,正确的是
- 以下关于结构体类型及变量的声明正确的是_____ A: struct student{char name[16];int age}stu1; B: struct student{int age, rank}stu1; C: struct student{char name[16];int age;float score;};student stu1; D: struct student{char name[16];int age, rank;float score;};struct student student;
- 以下各项用于定义结构体类型,并定义结构体变量,其中正确的是________。 A: struct student { char num[5]; int score; }; student stu1,stu2; B: struct student{ char num[5]; int score;};struct student stu1 stu2; C: struct student { char num[5]; int score=96; }; struct student stu1,stu2; D: struct student{ char num[5]; int score;};struct student stu1,stu2;
- 下面哪一个是JSON数据?() A: {name:"xiaoming",age,"student"} B: {"name":"xiaoming","age":"student"} C: {"xiaoming","student"} D: ["xiaoming","student"]