AI题库 · Python编程六级题库
题目分享 #6092
class Person():
def __init__(self, name, age):
self.name = name
self.age = age
def introduce(self):
return f"My name is {self.name} and I am {self.age} years old."
p = Person("Alice", 30)
print(p.introduce())以上Python代码,运行结果是?( )
A
My name is Alice and I am 30 years old.
B
My name is Person and I am 30 years old.
C
My name is Alice and I am 0 years old.
D
My name is 30 and I am Alice years old.
AI题库 · 编程考级与信奥赛真题库
查看答案 →
复制链接后可在微信、QQ、小红书等平台粘贴分享;答案与解析在题目页。