diff --git a/Schenk_Brandenberger_S2_Aufg3.py b/Schenk_Brandenberger_S2_Aufg3.py index 967f95b..350b77f 100644 --- a/Schenk_Brandenberger_S2_Aufg3.py +++ b/Schenk_Brandenberger_S2_Aufg3.py @@ -22,7 +22,7 @@ for i in range(50): sum_s_new = sn_new * n pi2 = sum_s pi2_new = sum_s_new - print("n: ", n, " sn: ", sn_new, " pi: ", pi2) + print(f'n: {n} sn: {sn_new} pi: {pi2}') x = np.append(x, n) y = np.append(y, pi2) y_new = np.append(y_new, pi2_new) @@ -31,12 +31,12 @@ for i in range(50): sn = s2n(sn) sn_new = s2n_new(sn_new) -plt.plot(x, y) -plt.plot(x, y_new) +plt.plot(x, y, label='2*pi') +plt.plot(x, y_new, label='2*pi_new') plt.xscale('log', base=2) plt.xlim((2 ** 3, 2 ** 31)) plt.ylim((6.25, 6.3)) -plt.legend(["2*pi", "2*pi_new"]) +plt.legend() plt.title("Aufgabe 3") plt.show()