Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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: line1 line 2 line3 write a program which converts the content into the following: line 3 this line has been inserted via Python code line2 line1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

Explain how the fraud can happened in the companies

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago