refactor: definice typů u funkcí
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from typing import Any
|
||||
from random import randint
|
||||
from os import system, name
|
||||
import re
|
||||
@@ -23,7 +24,7 @@ def throw(count: int) -> str:
|
||||
new_throw = "".join(new_throw)
|
||||
return new_throw
|
||||
|
||||
def show_throw(throw):
|
||||
def show_throw(throw: str) -> str:
|
||||
throw_temp = []
|
||||
for x in throw:
|
||||
throw_temp.append(x)
|
||||
@@ -43,7 +44,7 @@ def clear():
|
||||
else:
|
||||
_ = system('clear')
|
||||
|
||||
def evaluate(inp, count, throw):
|
||||
def evaluate(inp: Any, count: int, throw: str) -> tuple:
|
||||
inp = str(inp)
|
||||
if re.search("^\d+$", inp):
|
||||
if len(inp) > count:
|
||||
@@ -68,7 +69,7 @@ def evaluate(inp, count, throw):
|
||||
data = ("count", count, old_throw)
|
||||
return data
|
||||
|
||||
def check_value(throw):
|
||||
def check_value(throw: str) -> bool:
|
||||
throw_s = sorted(throw)
|
||||
throw_str = "".join(throw_s)
|
||||
hodnota = False
|
||||
|
||||
Reference in New Issue
Block a user