Last active
May 18, 2021 08:01
-
-
Save iwo-strzebonski/444bfa65758a735f65c00b83a32721a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = 0 | |
b = 0 | |
while (a <= 0 and b <= 0): | |
try: | |
a = float(input('Pierwszy bok [cm]: ')) | |
if a <= 0: | |
raise ValueError | |
b = float(input('Drugi bok [cm]: ')) | |
if a <= 0: | |
raise ValueError | |
except ValueError: | |
a = 0 | |
b = 0 | |
else: | |
break | |
print(f'Obwod prostokata: {2*a+2*b} [cm]\nPole prostokata {a*b} [cm]') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment