A programming genius called Hank Wrote a system to \'access\' his \'bank\' When
ID: 3678157 • Letter: A
Question
A programming genius called Hank
Wrote a system to 'access' his 'bank'
When his memory failed him
They nailed him then jailed him
Now his 'storage' is 'basic' and dank.
Explanation / Answer
python program:
#!/usr/bin/python
# Function definition is here
def sortFile(src,dst ):
fo = open(src,'r')
list1=list(fo)
list1.sort();
fos = open(dst, 'wb+')
str=" ".join(list1)
print str
fos.write(str)
fo.close()
fos.close();
return;
#function calling is here
sortFile("foo.txt","foos.txt")
output:
A programming genius called Hank
Now his 'storage' is 'basic' and dank.
They nailed him then jailed him
When his memory failed him
Wrote a system to 'access' his 'bank'
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.