我知道这是一个数据对象,但我是python的新手,我不明白user_output在做什么。试图理解这一切。什么是这个对象?
def user_output(self,check): #data object
output = ""
#loop of all the info for __user_arr
for user in self.__user_arr:
if user.user_bot == str(check):
output += '''
<div class='about'>
<h1>{user.user_name}</h1>
<h2>My favorite band is: {user.user_band} </h2>
<div class='business'>
<p>Why I want the tickets:<br /> {user.user_business}</p>
</div>
</div>
'''
return output.format(**locals())
else: #this will spit an error if the user do not answer the last question correctly.
output = '''<div class='error'><h2>Turns out you are a robot. No tickets for you </h2></div>'''
return output
未来,请在询问代码之前阅读[this](http://meta.stackoverflow.com/questions/253894/how-to-handle-explain-how-this-code-dump-works-questions)再次抛出问题。 – MattDMo 2014-10-20 22:26:42
对不起马特我的错误。 – Surf3rDud3 2014-10-20 22:28:14