diff --git a/P1/main.py b/P1/main.py index 7b7b315..16a26ad 100644 --- a/P1/main.py +++ b/P1/main.py @@ -1,5 +1,4 @@ import math -from operator import concat empty_element = { "count" : 1, @@ -105,8 +104,8 @@ def calculate(elements, m, message): reverse=True )) # Ausgabe - for x_i in sorted_by_information: - print(f"{elements[x_i]["count"]:3.0f} | {elements[x_i]["I(x_i)"]:15.12f} | »{x_i}«") + for x_i in sorted_by_element: + print(f"{elements[x_i]["count"]:3.0f} | {elements[x_i]["p(x_i)"]:10.7f} | {elements[x_i]["I(x_i)"]:10.7f} | »{x_i}«") print("Entropie der Nachricht = " + h.__str__() + "\n\n") def main():