定义类如下 Class Hello(): Def __init__(self, name): Self.name=name Def showInfo(self): Print(self.name) 下面代码能正常执行的 ( )
选项:
A:h = Hello; -h.showInfo()
B:h = Hello(); -h.showInfo(‘张三’)
C:h = Hello(‘张三’) ; -h.showInfo()
D:h = Hello(‘admin’); -h.showInfo
发布时间:2024-06-04 13:43:58