我的代码似乎没有工作,我试图找到一份工作,类别的输入和薪水,并存储输入Python的输入职位代码
class Jobs:
def GetJob(self):
name = raw_input('Enter a Job Title: ')
category = raw_input('Enter what Category that Job is: ')
salary = raw_input('Enter the salary of that Job: ')
print name,category, salary
def __init__(self,name,category,salary):
self.name = Jobs.GetJob(name)
self.category = Jobs.GetJob(category)
self.salary = Jobs.GetJob(salary)
GetJob = Jobs()
print GetJob
看来你使用 “的Python 2.x的” - 这样会推荐使用'类作业(对象):' – 2013-05-05 15:20:33