10.9 New exercise , before existing set
Bug #1393937 reported by
Sandy Garner
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Practical Programming in Python |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Make a text file with a series of integers e.g. 35 15 353 1 30 54 44 501
Write a function which will take a string parameter and print out that
string with a "$" sign before it and ",000" after it.
In the main routine, write code to open the file, read the contents to a
string, split the string into a list of "words" and use a for loop to send each
word to the function you wrote.
"""
"""
Extension:
Add K to some of the integers of the text file e.g. 35K 15 353K 1K 30 54K
44K 501
Adapt the function so it can remove the K if it is present, producing the
same output as before.
$35,000
$15,000
$353,000
$1,000
$30,000
$54,000
$44,000
$501,000
Changed in practical-programming: | |
status: | New → Fix Released |
To post a comment you must log in.