Hallo und gutes neues Jahr zusammen,
ich mache gerade einen Beginnerkurs (englisch) zu Python und habe eine Frage zur Formatierung von Zahlen > 3 Stellen.
In Deutschland ist es ja so, dass Zahlen, die mehr als drei Stellen haben mit einem Punkt dargestellt werden, der Lesbarkeit halber. Also 1000 = 1.000, 1000000 = 1.000.000 usw.
Folgender Code dazu:
x = float(input("What's x? "))
y = float(input("What's y? "))
z = round(x + y)
print(f"{z:,}")
Der Tutor macht das hier mit einem Komma, also amerikanische Schreibweise und meinte aber, dass man das für seinen Standort anpassen kann. Also anstatt dem Komma, das für den Standort übliche Zeichen.
Wenn ich das Komma aber durch einen Punkt ersetze, bekomme ich eine Fehlermeldung (ValueError: Format specifier missing Precision)
Wie bekomme ich die Ausgabe denn so hin, dass es mir die Zahlen mit einem Punkt anzeigt?
Vielen Dank im Voraus und VG