Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3 problems, please write in Python. Accumulator Pattern 1 point Compose a program which tests whether each character in a string text is alphabetic or
3 problems, please write in Python.
Accumulator Pattern 1 point Compose a program which tests whether each character in a string text is alphabetic or not. If it is not, then the character should be appended to a accumulator string non_alpha The text used is taken from T. S. Eliot's "Choruses from The Rock" Starter code (click to view) text-o world of spring and autumn, birth and dying! non_alpha for ??? in text: if ???.isalpha(): Accumulator Pattern 1 point Compose a program which counts the number of words on each line in a string text. The result should be stored in a list we_lines, with each line's count being a separate sequential entry in wc lines The text used is Hugh MacDiarmid's "On the Ocean Floor Starter code (click to view) text-Now more and more on my concern with the lifted waves of genius gaining I am aware of the lightless depths that beneath them lie; And as one who hears their tiny shells incessantly raining On the ocean floor as the foraminifera die.''' WC_lines[] for line in text.split( 'n) Accumulator Pattern 1 point Compose a program which counts the number of upper-case characters on each line in a string text. The result should be stored in a list upper_lines , with each line's count of upper-case characters being a separate sequential entry in upper_lines The text used is Arthur O'Shaughnessy's "We Are the Music Makers" Starter code (click to view) textWe are the music makers, And we are the dreamers of dreams, Wandering by lone sea-breakers And sitting by desolate streams;- World-losers and world-forsakers, On whom the pale moon gleams: Yet we are the movers and shakers Of the world for ever, it seems. upper_lines [ for line in text.split(n): countere for ??? in line: upper_lines.append counter)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started