= Zahl in String umwandeln = * Abgabetermin und Präsentationen: [[Treffen/2012-09]] Ziel ist es eine Funktion bzw. Programm zu schreiben, das eine Zahl in einen String umwandelt und dabei Trennzeichen zwischen jedem Block von drei Ziffern einfügt. Beispiele: * 10 => "10" * 1000 => "1.000" * 1000000 => "1.000.000" * 1999995.99 => "1.999.995,99" Optional soll man die Trennzeichen angeben können, sodass die Zahl auch in andere Formate umgewandelt werden kann. Beispiele: * 1000 => "1.000" oder "1,000" * 1000000 => "1.000.000" oder "1,000,000" * 1999995.99 => "1.999.995,99" oder "1,999,995.99" === Code Golf (optional) === If you want to participate in the ''shortest code possible'' contest where you have to ignore PEP-8 for once, these rules apply: * ''Program'': This script must be runnable as standalone script (read from stdin or files, or just use the "fileinput" module) * ''Library'': This script must be importable / usable as "library" (you can name the exported function "f") Of course, you can combine both into one script as well. The script must be self-contained. You can add your current status here (don't show the code until the meeting): || |||| '''Python 2''' |||| '''Python 3 ''' || || '''Name''' || '''Program''' || '''Library''' || '''Program''' || '''Library''' || || [[thp]] || 225 bytes || 132 (131*) bytes || 227 bytes || 132 bytes || https://gitlab.com/thp/python-quiz/tree/master/2012-09 || || [[hop]] || || 132 bytes || || || http://bitbucket.org/hopthrisC/pythonquiz || || [[DavidPoisl]] || || 126 (131) bytes || || 122 (127) bytes ||https://github.com/dpoisl/pyQuiz/tree/master/l10n || || [[fhahn|flo]] || 180 bytes || 132 (123*) bytes || 180 bytes || 132 (123*) bytes || https://github.com/fhahn/pyugat-pyquiz || || ''add yourself'' || ... || ... || ... || ... || || *after presentation