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 this bug :/
>
>
>     Traceback (most recent call last):
>       File "C:\Python31\makao.py", line 23, in <module>
>         nr_players=Hand.ask_number("Ilu graczy ma wziąść udział w grze
>     (2-5):",low=2,high=5)
>     TypeError: ask_number() takes exactly 4 non-keyword positional
>     arguments (1 given)
>
>
> my code
>
> |
>
> classHand(object):             
>     defask_number(self,question,low,high):   
>         response=None
>         whileresponse notinrange(low,high):
>             response=int(input(question))
>         returnresponse
>     defask_human_players(self,question,nr_player):
>         response=None
>         whileresponse notinrange(low,nr_player):
>             response=int(input(question))
>         returnresponse
>  
> nr_players=Hand.ask_number("Ilu graczy ma wziąść udział w grze
> (2-5):",low=2,high=5)
> print(nr_players)
>  
> human_players=Hand.ask_human_players("Ile graczy to ludzie",nr_players)
> print(human_players)
> |
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b825f565-98fb-4bf3-a136-58dfcb424dc5%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/b825f565-98fb-4bf3-a136-58dfcb424dc5%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/550419D5.1060503%40martinhome.org.uk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to