fork(1) download
  1.  
  2. def has_straight(self):
  3. #straight is a seuence of 5 cards or 4 cards + Ace
  4. #how to chek if it is a sequence?
  5. #ebaniy straight!
  6. chek = 0
  7. hand_ranks = []
  8. for card in self.cards:
  9. hand_ranks.append(card.rank)
  10.  
  11. h_ranks = sorted(set(hand_ranks))
  12.  
  13. for i in range(len(h_ranks)-1):
  14. if h_ranks[i]+1 == h_ranks[i+1]:
  15. chek += 1
  16. # Тут первая проверка покрывается второй.
  17. # Если check == 5, то и chek == 5 and 1 in hand_ranks.
  18. # Наверное должно быть 4.
  19. if chek == 5 and 1 in hand_ranks:
  20. return True
  21. if chek == 5:
  22. return True
  23. else:
  24. chek = 0
  25. return False
  26.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 125, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 735, in source_to_code
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "./prog.py", line 2
    def has_straight(self):
    ^
IndentationError: unexpected indent

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.5/py_compile.py", line 129, in compile
    raise py_exc
py_compile.PyCompileError: Sorry: IndentationError: unexpected indent (prog.py, line 2)
stdout
Standard output is empty