basic grammer error..

C

codefly

class codefly:

def WaitFreecatz(self, hours):
hours = self.hours
i = 1
while i < hours:
print 'i wait %s hours' %(i)
i = i+1
if i == hours:
print '\nhe never comes'


run error// what's wrong??
 
D

Diez B. Roggisch

codefly said:
class codefly:

def WaitFreecatz(self, hours):
hours = self.hours
i = 1
while i < hours:
print 'i wait %s hours' %(i)
i = i+1
if i == hours:
print '\nhe never comes'


run error// what's wrong??

Next time, be so kind to tell us what the actual error *is*, will you?

Because there is none for me after c'n'p-ing that code into a source-file...

Diez
 
C

codefly

Next time, be so kind to tell us what the actual error *is*, will you?

Because there is none for me after c'n'p-ing that code into a source-file....

Diez

Thank you Sir.^^
 
D

Dave Angel

codefly said:
class codefly:

def WaitFreecatz(self, hours):
hours = self.hours
i = 1
while i < hours:
print 'i wait %s hours' %(i)
i = i+1
if i == hours:
print '\nhe never comes'


run error// what's wrong??
You can't get a runtime error there, because nothing instantiates the
class, nor calls its method. Once you add that code, you'll find an
uninitialized instance attribute, plus a couple of logic errors.

So, if you actually have a question, how about stating it completely?
Given a complete code sample, you run it (on what version of what
computer language, on what OS), and you get some error (show complete
traceback). Explain what you tried, to identify the error, and then
state what has you stumped.

And if you don't get a Python error, but get the wrong results, then
state what you expected, and what you got.

DaveA
 
B

Bruno Desthuilliers

codefly a écrit :
class codefly:

def WaitFreecatz(self, hours):
hours = self.hours
i = 1
while i < hours:
print 'i wait %s hours' %(i)
i = i+1
if i == hours:
print '\nhe never comes'


run error// what's wrong??

wrt/ the code : bad capitalisation on the class name and method name,
access to an inexistant attribute, useless param 'hours' (not used),
failure to use the appropriate iteration construct.

wrt/ your post: failure to post both the full traceback and the minimal
required code to produce this traceback.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top