class Student:
def __init__(self, name, grade):
self.name = name
self.grade = grade
def introduce(self):
return f"私は{self.name}、{self.grade}年生です"
# 使用例
student1 = Student("太郎", 5)
print(student1.introduce()) # 私は太郎、5年生です
To embed this project on your website, copy the following code and paste it into your website's HTML: