Question: ~~~~Python~~~~ Open the file DontQuit.txt and then read in each line and print them. Use a while loop. Do the same thing as #1 except

~~~~Python~~~~

  1. Open the file DontQuit.txt and then read in each line and print them. Use a while loop.
  2. Do the same thing as #1 except this time use a FOR loop and ONLY print a line if the word "Life" is in it (there should be one line that is printed).

~~~~Python~~~~ Open the file DontQuit.txt and then read in each line and

When things go wrong, as they sometimes will, When the road you're trudging seems all uphill, When the funds are low but the debts are high, And you want to smile but you have to sigh, When care is pressing you down a bit... Rest if you must, but don't you quit!

Life is queer with its twists and turns, As every one of us sometimes learns, And many failures turn about When we might have won had we stuck it out. Don't give up though the pace seems slow... You may succeed with another blow.

Often the struggler has given up When he might have captured the victors cup; And he learned too late when the night came down, How close he was to the golden crown.

Success is failure turned inside out... And you can never tell how close you are It may be near when it seems so far. So stick to the fight when youre hardest hit Its when things seem worst that you must not quit.

When things go wrong, as they sometimes will, When the road you're trudging seems all uphill, When the funds are low but the debts are high, And you want to smile but you have to sigh, When care is pressing you down a bit... Rest if you must, but don't you quit! Life is queer with its twists and turns, As every one of us sometimes learns, And many failures turn about When we might have won had we stuck it out. Don't give up though the pace seems slow.., You may succeed with another blow. Often the struggler has given up When he might have captured the victor's cupi And he learned too late when the night came down How close he was to the golden crown. Success is failure turned inside out... And you can never tell how close you are It may be near when it seems so far. So stick to the fight when you're hardest hit It's when things seem worst that you must not quit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!