Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please code in python please add comments. .txt file is in the second pictire 1) Please provide the Python program that will read in the

please code in python
please add comments.
.txt file is in the second pictire image text in transcribed
image text in transcribed
1) Please provide the Python program that will read in the attached text file (project1.txt) and accomplish the following tasks: a. Read each line and print out the longest and the shortest word in each b. List out how many total lines exist and how many words are in each line. 1. i.e. line 1 - 7 words, line 2-5 words. c. Keep a running total of how many words contain exactly 3 and 6 characters individually and print the results after program completes. 1. i.e. 7 words contain exactly 3 letters and 14 that contain exactly 6 letters. d. Rewrite the phrases and pass the results to a file called project1-reordered.txt so that the smallest line (total characters in a line) is now the first line and the largest line is last. 1. i.e. make this a descending order. e. -Rewrite the lines so that the lines appear without any of the authors of the quotes and display this list to the screen. f. Create a new file that contains the just the list of the authors and place them into text file project i-authors.txt and list them in ascending order 1. Alexander the Great ini. iv. V. vi. Steve Jobs 8. Find the first 2 words of each phrase and replace the first 2 words of the previous line. Note: swap last line (and that's all) with the first line (if your actions) 1. Original 1. If your actions inspire others to dream more, learn more, do more and become more, then you are a leader. - John Quincy Adams 2. Peace begins with a smile. - Mother Teresa Hi New 1. And that's all inspire others to dream more, learn more, do more and become more, then you are a leader. - John Quincy Adams 2. If your actions a smile. Mother Teresa 3. Peace begins with of quality as some people aren't used to an environment where excellence is expected. - Steve Jobs If your actions inspire others to dream more, learn more, do more and become more, then you are a leader. John Quincy Adams Peace begins with a smile. Mother Teresa Be a yardstick of quality as some people aren't used to an environment where excellence is expected. Steve Jobs A genuine leader is not a searcher for consensus but a molder of consensus. - Martin Luther King Jr I am not afraid of an army of lions led by a sheep; I am afraid of an army of sheep led by a lion. Alexander the Great And that's all I have to say about that. Forrest Gump

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

Databases Illuminated

Authors: Catherine M. Ricardo

1st Edition

0763733148, 978-0763733148

More Books

Students also viewed these Databases questions

Question

=+What is your previous foreign address?

Answered: 1 week ago