Question: In python, Write a function that takes, as arguments, a positive integer n and a string, myString, and creates a file, named nCharacters.txt, containing nlines,
In python, Write a function that takes, as arguments, a positive integer n and a string, myString, and creates a file, named nCharacters.txt, containing nlines, where each line contains a randomly selected character in myString. The case of characters is preserved with this function. Name this function randomCharacters(n, myString).
For example,
>>>>
randomCharacters(5,The quick brown fox jumps over the lazy dog.) would create the file named nCharacters.txt. The contents of this file would be something of the form:
q
T
f
.
j
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
