On 08/10/2012 01:28 PM, Chuck wrote:
Thanks for the help guys!  I finally got it working.  Shouldn't I technically 
call quiz() through the constructor, though?  Otherwise, the constructor is 
pointless.  I just put in pass for now.

For this particular example, frankly, a class doesn't make sense. Just write it as a set of independent functions. A class would make more sense if you wanted to make this a generic Quiz class, then you could change the actual quiz simply by passing an appropriate dictionary to it when it's instantiated. But even that could be done with simple functions as well.

(Also, I always thought that if __name__ == '__main__': went IN the class.  Why 
wouldn't it be apart of the class?  )

No way! That's nonsense also. You need to go through some introductory tutorials. Just keep in mind that Python and Java are VERY different languages. (I don't know Java myself, my (hobby) programming background has been with C, and I'm still just starting to learn Python, too.)


Thanks again!


     -=- Larry -=-

PS. On another subject... You need to check your newsreader -- all your responses have been double-posted.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to