updated repository with strict typechecking
Some checks failed
Actions / Lint Code (Ruff & Pylint) (push) Failing after 11s
Some checks failed
Actions / Lint Code (Ruff & Pylint) (push) Failing after 11s
This commit is contained in:
parent
14c41cfd45
commit
68569900e0
5 changed files with 30 additions and 24 deletions
|
@ -12,10 +12,10 @@ def calculate_hypotenuse(x: float, y: float) -> float:
|
|||
return sqrt(x**2 + y**2)
|
||||
|
||||
if __name__ == "__main__":
|
||||
x = input(f"{BLUE}Input your A:{RESET} ")
|
||||
y = input(f"{BLUE}Input your B:{RESET} ")
|
||||
x: str = input(f"{BLUE}Input your A:{RESET} ")
|
||||
y: str = input(f"{BLUE}Input your B:{RESET} ")
|
||||
try:
|
||||
result = calculate_hypotenuse(x,y)
|
||||
result: float = calculate_hypotenuse(float(x), float(y))
|
||||
print(f"{GREEN}{round(result)} ({result}){RESET}")
|
||||
except ValueError:
|
||||
print(f"{RED}Please do not input strings.{RESET}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue