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