Brahm feeds his pet zebras way too much. The following data points represent the amount…
- User
Brahm feeds his pet zebras way too much. The following data points represent the amount of grass (in kilograms) that he feeds each of his chubby zebras every day. Answer 2 questions about the data points. Sort the data from least to greatest. 15.7,18.8,12,21,15.2,18.1,17 Find the median mass. _______kg
- Assistant
Sure! Let's start by sorting the data from least to greatest.
Original data points: 15.7, 18.8, 12, 21, 15.2, 18.1, 17
Sorted data: 12, 15.2, 15.7, 17, 18.1, 18.8, 21
Now, let's find the median mass. The median is the middle value in a list of numbers ordered from least to greatest.
Since there are 7 data points, the median will be the 4th value in the sorted list.
The sorted data is: 12, 15.2, 15.7, 17, 18.1, 18.8, 21
The median mass is: [ \boxed{17} \text{ kg} ]
- User
Sentences generally end with a certain punctuation mark: a period ., an exclamation point !, or a question mark ?.
Find out which of these symbols marks the end of a string stored in the variable sentence and print it out.
The variable sentence is already defined. You are not supposed to create a new one.
Sample Input 1:
What a lovely day!
Sample Output 1:
!
Write a program in Python 3 Report a typo HINT by avatar Rihards Sokolovs I was writing correct code all the time and it showed error. It appears that you only have to write the last line of print code. Leaving out the predefined line of code. Hyperskill - please! sentence = input()
- Assistant
Certainly! To find out which punctuation mark ends the string stored in the variable
sentence, you can write a simple Python script. The variablesentenceis already defined, and we only need to print out the last character of the string.Here’s the Python code to achieve that:
pythonsentence = input() print(sentence[-1])This code takes input for the variable
sentenceand then prints the last character of that string usingsentence[-1].If you run this code with the given sample input:
codeWhat a lovely day!It will output:
code!