See explaination
Explanation:
#method to print menu & handle user choice
def print_menu(input_str):
#printing menu
print('MENU')
print('c - Number of non-whitespace characters')
print('w - Number of words')
print('f - Fix capitalization')
print('r - Replace punctuation')
print('s - Shorten spaces')
print('q - Quit\n')
#getting choice
choice=input('Choose an option: ').lower()
#identifying choice
if choice=='c':
#displaying number of non white space chars in input_str
print('Number of non-whitespace characters:',get_num_of_non_WS_characters(input_str))
elif choice=='w':
#displaying number of words in input_str
print('Number of words:',get_num_of_words(input_str))
elif choice=='f':
#fixing capitalization and getting updated string and count of values capitalized
input_str,count=fix_capilization(input_str)
#displaying results
print('Number of letters capitalized:',count)
print('Edited text:',input_str)
elif choice=='r':
#replacing punctuation, displaying updated text
input_str=replace_punctuation(input_str)
print('Edited text:', input_str)
elif choice=='s':
#shortening spaces and displaying updated text
input_str = shorten_space(input_str)
print('Edited text:', input_str)
#returning choice and input_str
return choice,input_str
#returns the number of non white space chars in input_str
def get_num_of_non_WS_characters(input_str):
count=0
#looping through each character in input_str
for i in input_str:
if not i.isspace():
#i is not a space
count+=1
return count
#returns the number of words in input_str
def get_num_of_words(input_str):
#splitting words into list of tokens by space
words=input_str.split(' ')
count=0
#counting all non empty strings in words list
for i in words:
if len(i)>0:
count+=1
return count
#method to fix capitalization and return updated string and count of letters updated
def fix_capilization(input_str):
count=0
beginning=True #starting letter should be capitalized
result=''
for i in input_str:
if beginning and i.isalpha():
#start of a sentence and i is alphabetic
if i.islower():
#converting i to upper case, incrementing count
i=i.upper()
count+=1
result+=i
#not start of a sentence
beginning=False
elif i in '?.!':
#i is either ? or . or !, next letter should be capitalized
beginning=True
result+=i
else:
#any other character
result+=i
return result,count
#method to replace exclamation and semicolons with period and comma respectively
def replace_punctuation(input_str,exclamationCount =0,semicolonCount=0):
result=''
for i in input_str:
if i=='!':
i='.'
exclamationCount+=1
elif i==';':
i=','
semicolonCount+=1
result+=i
print('Punctuation replaced')
#displaying replaced values counts
print('exclamationCount:',exclamationCount)
print('semicolonCount:',semicolonCount)
return result
#removes all double or more spaces in input_str
def shorten_space(input_str):
input_str=input_str.strip()
result=''
prev=None
for i in input_str:
if prev==None:
result+=i
elif i==' ':
if prev != ' ':
result+=i
else:
result+=i
prev=i
return result
if __name__ == '__main__':
#getting input, printing it
input_str=input('Enter a sample text:\n')
print('\nYou entered:',input_str)
choice=' '
#looping until choice becomes q
while choice!='q':
choice,input_str=print_menu(input_str)
Answer: B. the uncontrollable power of nature.
In this passage, we can see how powerful the colossal Moby-Dick is, and how frail and insignificant humans appear to be by comparison. When Ahab wants to fight with the whale, he is completely helpless and is easily defeated and injured. The power of the whale is a symbol that represents the incontrollable power of nature.
neither black nor white but they were called Colored people
Answer:
Please, see below:Step-by-step explanation:
Thoreau states, “… When an acorn and a chestnut fall side by side… bothobey their own laws…” (3). This can be interpreted as success being obtainable withoutthe assistance of another. The acorn and the chestnut are two individuals that are uniquein their own way yet had the same result. The same goes for people; for those reachingthe same goal as another, it is much better to do it under your qualities and your own way.The purpose of this passage was for Thoreau to inform his audience on his viewson the government and its negative affects on civilization. With its restrictions, peoplecannot fully live up to their potential because the bureaucracy will always limit them.Thoreau wants his audience to become successful in their own manor and uses theserhetorical devices to sync with his readers
Answer:
There is gradual shift of point of view in the story “An OccurrenceStep-by-step explanation:
●''Owl Creek Bridge'' isn't a first-person narration, meaning that it's not told from the perspective of the main character, meaning Farquhar. Instead, the text comes from a third-person narrator, or told by an external force or character.
●In some sense, Bierce presents readers with an unreliable third-person narrator. The narrator knows, the entire time, that Peyton is dreaming, but tricks readers into thinking that Peyton has escaped. By representing the scenes of Peyton's dream as reality, the narrator toys with the reader's emotions.
●In “An Occurrence at Owl Creek Bridge” a couple of shifts throughout the story change the entire story's point of view essentially bewildering readers. For instance, in paragraph five, a shift occurs when Peyton Farquhar closes his eyes right before he is to be hung.
●In paragraph 36 of "An Occurrence at Owl Creek Bridge," Bierce shifts from past tense to present tense. Bierce writes that "now he sees another scene . . . he stands at the gate of his own home." The effect here is that the reader believes Farquhar has truly escaped and made it home.
Answer:
In lines 578-579, Mrs. Keeney tells her husband why she wanted to sail with him: "I wanted to seeStep-by-step explanation:
make necessary changes as required to make the points better
Lange’s work was significantly influenced by her experiences.
Answer:
The phrase "we'll head north again, in other words, to the land of sensible people" shows that the entire venture, planned by the Professor and the Captain was not wise. It has a critical tone.Step-by-step explanation:
The phrase above was uttered by the Canadian in the book, "Twenty Thousand Leagues Under the Seas Revised" By Jules Verne. He meant that the venture which they had undertaken was fruitless and unwise.
He criticized the journey because at that time the Nautilus was stuck in the ice and could no longer move forward.
Answer:
Please, see below:Step-by-step explanation:
Based on the context of the presented proposal, we can give such a definition:
Reverence is a feeling of deep respect or awe, in this case for nature. Reverence can be a feeling of awe, and it can also describe how you feel about something, especially.
Answer:
check belowStep-by-step explanation:
George and Lennie dream of getting their own farm. George wants the independence that comes with owning his own land, and Lennie wants to have rabbits. Their dream is the central theme in the story. It is their dream that brings them to the ranch, and that dream spreads to Candy and Crooks.
George is small while Lennie is burly in terms of physical size. George is cunning and calculating while Lennie is obtuse and carefree. But from the early scene where the two stopped to drink water, you can already perceive that George is the one who looks after Lennie.
Lennie and George have an argument over a mouse that Lennie has petted a little too hard and long. Lennie wants to keep the dead mouse in his pocket, but George throws it away.
It will provide an instant answer!