Question 4: Quote Filename: quote.py Write a program that reads in an integer representing the number of sentences in the quote. For each sentence in the quote, the program should prompt for the length of the sentence and then read in that number of words from the keyboard. At the end of each sentence add a period ("") and go to the next line. After all of the words in the quote are read, then print the quote to the screen. For example: Number of sentences: 4 Enter length: 3 < Roses < are < red Enter length: 3 < Violets < are < blue Enter length: 4 < There < is < no < try Enter length: 5 < Just < do < not < or < do Quote: > Roses are red. > Violets are blue. > There is no try. > Just do not or do.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
The ask is to write a python program doing the following:
- take user input for number of sentences
- take user input for length of each sentence
- take user input for each word
- print the quote
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images