Greater heights python assignment expert

Answer to Question #243366 in Python for Sho

Write a program that asks the user for their name and their height in inches ["Enter your name: ", "Enter your height in inches: "]. The program should display the person's name and whether they are short, average, or tall. Short is less than 60 inches and tall is greater than 72 inches in between is average height. Display the output in the following format as an example: [Joe, " your height is short"]

name = input["Enter your name: "]
height = int[input["Enter your height in inches: "]]
if height < 60:
    print[ name + ", 'your height is short "]
elif height > 72:
    print[name + ", 'your height is tall "]
else:
    print[name + ", 'your height is average "]

Learn more about our help with Assignments: Python

Area of Largest Rectangle in Histogram:

Given a list of integer heights representing the histograms bar height where the width of each bar is 1, return the area of largest rectangle in the histogram.

Input: The input will be a single line containing space-separated integers, denoting the heights of the bars.

Output: The output should be a single line containing the area of the largest rectangle in the rectangle.

Sample Input 1:

2 1 5 6 2 3

Sample Output 1:

10

Sample Input 2:

65 87 96 31 32 86 57 69 20 42

Sample Output 2:

248

def ​maximumArea[histogram]:
   ​stack = list[]

   ​max_area = 0
   ​index = 0
   ​while index < len[histogram]:

       ​if [not stack] or [histogram[stack[-1]] 

Chủ Đề