我是编程和python本身的新手。我陷入下面提到的代码中 我本人尝试对其进行故障排除,但没有成功。
class Student:
def __init__(self,name,contact):
self.name = name
self.contact = contact
def getdata(self):
print ("Accepting Data")
self.name = input("Enter the name of student: ")
self.contact = input("Enter contact number: ")
def putdata(self):
print ('The name is:' +self.name,'Contact number of student you entered is:' +self.contact)
John = Student("blank",0)
John.getdata()
John.putdata()
答案 0 :(得分:0)
我切换到python3并得到解决