Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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