COMP-1034: Files and CSV Practice Problems 1. Write a Python script to read a text file and display its content. 2. Write a Python script to write a text file with some content. 3. Write a Python script to append text to an existing text file.

Fundamentals of Information Systems
9th Edition
ISBN:9781337097536
Author:Ralph Stair, George Reynolds
Publisher:Ralph Stair, George Reynolds
Chapter7: Knowledge Management And Specialized Information Systems
Section: Chapter Questions
Problem 19RQ
icon
Related questions
Question

COMP-1034: Files and CSV Practice Problems
1. Write a Python script to read a text file and display its content.
2. Write a Python script to write a text file with some content.
3. Write a Python script to append text to an existing text file.
4. Write a Python script to copy the contents of one file into another file.
5. Write a Python script to count the number of lines in a text file.
6. Write a Python script to read a text file and find the longest word.
7. Write a Python script to read a text file and find the shortest word.
8. Write a Python script to read a text file and replace a specific word with another word.
9. Write a Python script to read a CSV file and display the data.
10. Write a Python script to write a CSV file with some data.
11. Write a Python script to append data to an existing CSV file.
12. Write a Python script to count the number of rows in a CSV file.
13. Write a Python script to count the number of data rows in a CSV file. This means to exclude
the header row.
14. Write a Python script to count the number of columns in a CSV file. The columns are
identified on the first row.
15. Write a Python script to read a CSV file and display the first 5 rows not including the column
headers.
16. Write a Python script to read a CSV file and display the last 5 rows.
17. Create a CSV file in Jupyter that has 5 stocks: symbol, company name and quantity of
shares. Write a Python script to read the CSV file and calculate the sum of shares.
18. Write a Python script to read the CSV file in #17 and calculate the average number of
shares.
19. Write a Python script to read a CSV file in #17 and find the stock with the maximum number
of shares. 

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Linux
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781337097536
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning