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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!