Keep getting this in PyDev "TypeError: quiz() takes exactly 1 argument (0 given)"

Larry Hudson orgnut at yahoo.com
Fri Aug 10 23:11:55 EDT 2012


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.




More information about the Python-list mailing list