Question: Please write a Python code Your program should use a list to store the sentences input by user(the list should be able to store any
Please write a Python code
- Your program should use a list to store the sentences input by user(the list should be able to store any number of sentences added by user).
- The inputs to the list will be ended by the user by answering a question about whether they want to add any additional sentences to the list. The user will answer yes or no; however, you dont know what letter case will be used to enter the answer. Also, the user may just enter the first letter for their response. You can only use a single condition (in an IF statement or loop condition) to determine whether to end input or continue (hint: use a string manipulation command to help with this).
- Once the list has been populated, ask the user which sentence in the list they want to extract a word from and which number word they wish to extract. (dont have to account for the potential that the user enters a sentence number or word number that doesnt exist. ) Once you have these two inputs, youll need to get the right sentence from the list and then get the right word from that sentence.
- you will then print the word, centered, within a 20-character field with asterisks (*) on either side in the remaining character slots that arent occupied by the word (********best********)
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
