Добавлена глава по типам коллекций

This commit is contained in:
Sergey Lemeshevsky
2020-03-02 12:29:02 +03:00
parent af27efd7f6
commit 2756a9b834
20 changed files with 3162 additions and 950 deletions

View File

@@ -18,6 +18,7 @@ def get_float(msg, allow_zero):
return x
# End get_float
# Start 1st block
print("ax\N{SUPERSCRIPT TWO} + bx + c = 0")
a = get_float("enter a: ", False)
@@ -34,7 +35,7 @@ if discriminant == 0:
else:
if discriminant > 0:
root = math.sqrt(discriminant)
else: # discriminant < 0
else: # discriminant < 0
root = cmath.sqrt(discriminant)
x1 = (-b + root) / (2 * a)
x2 = (-b - root) / (2 * a)