Re: [Python] Problem with arguments given

2015-03-14 Thread Babatunde Akinyanmi
On 14 Mar 2015 12:22, "John" wrote: > > > Dariusz, > > You've declared ask_number() as an instance method in class Hand. You are calling it as if it was a class method. See https://docs.python.org/3.1/tutorial/classes.html. > In other words, you have to first create

Re: [Python] Problem with arguments given

2015-03-14 Thread Anderson Resende
Change your method: def ask_number(self,question,low,high): response=None while response not in range(low,high): response=int(input(question)) change self to class: This way you can call the method directly from Hand. @classmethod def

Re: [Python] Problem with arguments given

2015-03-14 Thread John
Dariusz, You've declared ask_number() as an instance method in class Hand. You are calling it as if it was a class method. See https://docs.python.org/3.1/tutorial/classes.html. John On 14/03/15 08:30, Dariusz Mysior wrote: > Mam jeden problem nie wiem dlaczego mam bład > I have problem with

[Python] Problem with arguments given

2015-03-14 Thread Dariusz Mysior
Mam jeden problem nie wiem dlaczego mam bład I have problem with this bug :/ Traceback (most recent call last): > File "C:\Python31\makao.py", line 23, in > nr_players=Hand.ask_number("Ilu graczy ma wziąść udział w grze > (2-5):",low=2,high=5) > TypeError: ask_number() takes exactly 4