1 Files 1. Create a text file, my_file.txt, and write 3 interesting facts about python into it (you may use python, or nano, or any means you choose to create the file). For example the file might contain: Python is named after Monty Python Python has a Zen of Python etc In python, write code that uses a loop to read the contents of the file and prints each line. 2. Write a Python program to write the elements of the list color = ['Red', 'Green', 'White', 'Black','Pink', 'Yellow'], to a file called "color_list_file.txt", with each element in a new line. 3. Now, write code that reads all lines from a "color_list_file.txt" except line 5 and print the colors 4. Read the contents of the file "color_list_file.txt" and print the number of letters in its contents. 5. print the count of the number of files in your current working directory. 6. write a program that gets the name and age of a person and stores it into a dictionary with name and age as the keys. Get age and name input data from 5 users, and store it in a new file called data.txt. To verify your work, write code that reads data.txt and prints out the people and their ages. 7. create a file called lines.txt which contains the following lines: linel line2 line3 write a program which converts the content into the following: line3 this line has been inserted via Python code line2 linel

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

fast pls i will give you like for sure pls solve this question correctly in 5 min pls 

 

Please help me with this, we are using python for coding thanks!

 

1 Files
1. Create a text file, my_file.txt, and write 3 interesting facts about python into it (you may use python, or
nano, or any means you choose to create the file). For example the file might contain:
Python is named after Monty Python
Python has a Zen of Python etc
In python, write code that uses a loop to read the contents of the file and prints each line.
2. Write a Python program to write the elements of the list color = ['Red', 'Green', 'White', 'Black','Pink',
'Yellow'], to a file called "color_list_file.txt", with each element in a new line.
3. Now, write code that reads all lines from a "color_list_file.txt" except line 5 and print the colors
4. Read the contents of the file "color_list_file.txt" and print the number of letters in its contents.
5. print the count of the number of files in your current working directory.
6. write a program that gets the name and age of a person and stores it into a dictionary with name and
age as the keys. Get age and name input data from 5 users, and store it in a new file called data.txt. To
verify your work, write code that reads data.txt and prints out the people and their ages.
7. create a file called lines.txt which contains the following lines:
line 1
line2
line3
write a program which converts the content into the following:
line3
this line has been inserted via Python code
line2
line 1
Transcribed Image Text:1 Files 1. Create a text file, my_file.txt, and write 3 interesting facts about python into it (you may use python, or nano, or any means you choose to create the file). For example the file might contain: Python is named after Monty Python Python has a Zen of Python etc In python, write code that uses a loop to read the contents of the file and prints each line. 2. Write a Python program to write the elements of the list color = ['Red', 'Green', 'White', 'Black','Pink', 'Yellow'], to a file called "color_list_file.txt", with each element in a new line. 3. Now, write code that reads all lines from a "color_list_file.txt" except line 5 and print the colors 4. Read the contents of the file "color_list_file.txt" and print the number of letters in its contents. 5. print the count of the number of files in your current working directory. 6. write a program that gets the name and age of a person and stores it into a dictionary with name and age as the keys. Get age and name input data from 5 users, and store it in a new file called data.txt. To verify your work, write code that reads data.txt and prints out the people and their ages. 7. create a file called lines.txt which contains the following lines: line 1 line2 line3 write a program which converts the content into the following: line3 this line has been inserted via Python code line2 line 1
Expert Solution
steps

Step by step

Solved in 4 steps with 7 images

Blurred answer
Knowledge Booster
File Input and Output Operations
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education