parse modulesdocumentation in python' standard library manual in some scenariosyou might also use the built-in input functionused in and to prompt the shell user for test inputs instead of pulling them from the command line also see ' discussion of the new {,dstring format method syntax added in python and this formatting extension separates thousands groups with commas much like the code here the module listed herethoughadds money formattingcan be changedand serves as manual alternative for comma insertions in earlier pythons currency symbolsunicode in action this module' money function defaults to dollarsbut supports other currency symbols by allowing you to pass in non-ascii unicode characters the unicode ordinal with hexadecimal value for exampleis the pound symboland is the yen you can code these in variety of formsasthe character' decoded unicode code point ordinal (integerin text stringwith either unicode or hex escapes (for compatibilityuse leading in such string literals in python the character' raw encoded form in byte string that is decoded before passedwith hex escapes (for compatibilityuse leading in such string literals in python xthe actual character itself in your program' textalong with source code encoding declaration we previewed unicode in and will get into more details in but its basic requirements here are fairly simpleand serve as decent use case to test alternative currenciesi typed the following in fileformats_currency pybecause it was too much to reenter interactively on changesfrom __future__ import print_function from formats import money print(money( )money( '')print(money(xcurrency= '\xa ')money(xcurrency= '\ ')print(money(xcurrency= '\xa decode('latin- '))print(money(xcurrency= '\ ac')money( '\xa decode('iso- - '))print(money(xcurrency= '\xa decode('latin- '))the following gives this test file' output in python in idleand in other contexts configured properly it works the same in because it prints and codes strings portably per __future__ import enables print calls in and as intro advanced module topics