Write a python program that has the following functionality: 1. read input from a file containing a list of words (each word is written on its own line) and store the data (strings) in a list Hint: try using the readline() function or a for loop 2. randomly select a string from the list 3. output / write the selected string to a new file
Write a python program that has the following functionality: 1. read input from a file containing a list of words (each word is written on its own line) and store the data (strings) in a list Hint: try using the readline() function or a for loop 2. randomly select a string from the list 3. output / write the selected string to a new file
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
Related questions
Question
100%
Write a python
1. read input from a file containing a list of words (each word is written on its own line) and store the data (strings) in a list
Hint: try using the readline() function or a for loop
2. randomly select a string from the list
3. output / write the selected string to a new file
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT