Re: UnboundLocalError

2006-11-11 Thread Camellia
Oh thank you for pointing that out Fredrik, you made the case more clear:) On Nov 11, 7:19 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Camellia wrote: > > Oh how can I thank you enough, you make my day:) > > According to what you said I finally figure it out, it is the

Re: UnboundLocalError

2006-11-11 Thread Camellia
? On Nov 11, 6:18 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: On Nov 11, 6:18 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Saturday 11/11/2006 02:35, Camellia wrote: > > >But sorry I'm so dumb I can't say I really understand, > >what do I actua

Re: UnboundLocalError

2006-11-11 Thread Camellia
11, 6:18 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Saturday 11/11/2006 02:35, Camellia wrote: > > >But sorry I'm so dumb I can't say I really understand, > >what do I actually do when I define a function with its name "number"?Don't >

Re: UnboundLocalError

2006-11-10 Thread Camellia
Thank you all so much for all the replies:) But sorry I'm so dumb I can't say I really understand, what do I actually do when I define a function with its name "number"? why does a name of a function has something to do with a variable? Oh wait can I do this in Python?: def a(): def b() so

UnboundLocalError

2006-11-09 Thread Camellia
hi all why it generates an "UnboundLocalError" when I do the following: ... def main(): number = number() number_user = user_guess() while number_user != number: check_number(number = number, number_user = number_user) number_user = user_guess() UnboundLocalError: lo

Re: humble coin head or tail game script I wrote

2006-10-07 Thread Camellia
OK so this is the result after I taking everything I'm teached in this thread: print 'Predict Head or Tail in ten times coin thrown\nJust input \'h\' or \'t\' please\n' count = 0 user_input = [] while len(user_input) < 10: print '\nNo.', len(user_input)+1, ', h or t?' pre_user = raw_inp

Re: humble coin head or tail game script I wrote

2006-10-07 Thread Camellia
le here Peace Kelvin Steve Holden wrote: > Camellia wrote: > > Oh I get it and ashamed, thank you for explaining it to me:) > > > > so I sould: > > ini_guess=random.randrange(2) > > > > for item in list: > > if item=='h': > &g

Re: humble coin head or tail game script I wrote

2006-10-06 Thread Camellia
Oh I get it and ashamed, thank you for explaining it to me:) so I sould: ini_guess=random.randrange(2) ... for item in list: if item=='h': ... if item ==t': ... [EMAIL PROTECTED] wrote: > Camellia wrote: > > Well...It' doesn't, have yo

Re: humble coin head or tail game script I wrote

2006-10-06 Thread Camellia
Well...It' doesn't, have you run it yet? its hypothesis is people don't predict a set of things randomly. Oxyd wrote: > Um... It looks to me like it just counts the number of times you > entered 't'... -- http://mail.python.org/mailman/listinfo/python-list

humble coin head or tail game script I wrote

2006-10-06 Thread Camellia
Hi there this is an easy game which was inspired from my psychology class. I'll get 5/10 right prediction of your guess of head and tail at most time. If you could copy the code and run it that would be great:) code: --- # Head or Tail # # Get a list which contains 10 values f

Re: How to return an "not string' error in function?

2006-09-21 Thread Camellia
I've learned a lot from you two, thank you:) Peace -- http://mail.python.org/mailman/listinfo/python-list