题海让大学四年没有难题
白天模式登陆

题目详情

单选题 关于下列Python代码的表述正确的是() class Cat: def __init__(self, Age,Eye_color="blue"): self.age = age self.eye_color = eye_color cat = Cat(1) print(cat.age,cat.eye_color)

A. 程序无法运行,self.age=age应为self.Age=age,self.eye_color=eye_color应为self.Eye_color=eye_color

B. 程序无法运行,self.age=age应为self.age=Age,self.eye_color=eye_color应为self.eye_color=Eye_color

C. 程序无法运行,self.age=age应为self.Age=Age,self.eye_color=eye_color应为self.Eye_color=Eye_color

D. 程序无法运行,cat=Cat(1)应为cat=cat(1)

学科:Python语言程序设计

时间:2023-12-09 19:35:44

Copyright © 2022 津ICP备2021001502号