Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
2
Posts with Upvotes
2
Upvoting Members
2
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
0 Endorsements
~14.4K People Reached
Favorite Tags
Member Avatar for vegaseat
Member Avatar for Reverend Jim
15
13K
Member Avatar for royng
Member Avatar for Netcode
0
387
Member Avatar for Niles64

Hi Please take a look at [CODE=python] class ShortInputException(Exception): #QUESTION: Why do I have to inherit from the "Exception" class? def __init__(self, length, atleast): Exception.__init__(self) #QUESTION: Why do I have to add this? self.length = length self.atleast = atleast try: s = raw_input('Enter something --> ') if len(s) < 3: …

Member Avatar for Niles64
0
118
Member Avatar for Niles64

Hi OK, so I am reading on OOP in Python, and I am an old C/C++ programmer so I have somewhat high expectations :). My question is regarding private/public variables. Per default, all class data members are public, but if we precede them with a double underscore, they become private. …

Member Avatar for TrustyTony
0
207
Member Avatar for pseudorandom21

Not to promote the use of alcohol, but it is in most places legal at least. Well I turned 21 a few months ago, so I'm wondering what everyone else drinks when relaxing on their off days? I like: Miller Lite Bud Light Other non-traditional (non-mass-produced) beers like dos equis, …

Member Avatar for Niles64
0
325
Member Avatar for Niles64

Hi Everything in Python is treated as an object, so [CODE] i=5 i.imag [/CODE] makes sense, i.e. the variable [I]i[/I] has some associated methods. But why doesn't the following example work? [CODE] 5.imag #error [/CODE] One would think that it should work, since the integer "5" is an object just …

Member Avatar for Niles64
1
112