首页题目详情

下列选项中,哪一个是创建类的一个正确方式?

题目配图
A.class Student: ...
B.new Student()
C.Student()
D.define Student()

优质解答

答案

A

解析

在Python中,定义类使用'class'关键字,格式为'class 类名: ...'。其他选项不符合Python语法。

查看答案和解析

支付 ¥0.1 即可查看此题答案和详细解析

低至 ¥0.1 起

理论知识部分单选题中等AI生成