Saturday, March 14, 2015

[Python] Problem with arguments given

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


class Hand(object):              
   
def ask_number(self,question,low,high):    
        response
=None
       
while response not in range(low,high):
            response
=int(input(question))
       
return response
   
def ask_human_players(self,question,nr_player):
        response
=None
       
while response not in range(low,nr_player):
            response
=int(input(question))
       
return response
 
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+unsubscribe@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/b825f565-98fb-4bf3-a136-58dfcb424dc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment