File Handling Task

Programming Questions

1. Write a program to read an entire text file.

2. Write a program to read an entire text file.

3. Write a program to read a file line by line and store it in a list.

4. How to access to append text to a file and display the text?

5. Write a  program to create function to create and print a list where the values are squares of numbers between 1 and 20

6. Write a program to read a file line by line and store it in an array.

7. Write a program to create a function and execute a string containing Python code.

8. Write a program to find the longest words.

9. Write a program to create to count the number of lines in a text file.

10. Write a program to copy the contents of a file to another file.

Theory Questions

1. What is file handling?

2. What are file handling modes?

3. How to create a text file?

4. How to read a text file?

5. What is the close() method? example

6. What is the write() method? example

7. What is a file position?

8. What is a rename() method?

9. What is the remove() method?

10. What is the rmdir() method?