Write a program which allows the user to input a list of five numbers.Write a program which allows the user to input a list of five numbers,then tells them the smallest,largest and median of the numbers they have entered.Hint:use the .sort() method o

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/13 03:48:52

Write a program which allows the user to input a list of five numbers.Write a program which allows the user to input a list of five numbers,then tells them the smallest,largest and median of the numbers they have entered.Hint:use the .sort() method o
Write a program which allows the user to input a list of five numbers.
Write a program which allows the user to input a list of five numbers,then tells them the smallest,largest and median of the numbers they have entered.Hint:use the .sort() method of the list.

Write a program which allows the user to input a list of five numbers.Write a program which allows the user to input a list of five numbers,then tells them the smallest,largest and median of the numbers they have entered.Hint:use the .sort() method o
def largest(data):
return data[len(data)-1]
def smallest(data):
return data[0]
def median(data):
return sum(data)*1.0/len(data)
def calc(data):
data.sort()
print 'Largest:  ' + str(largest(data))
print 'Smallest: ' + str(smallest(data))
print 'Median:   ' + str(median(data))
if __name__ == '__main__':
data = [10,9,6,10,5,-1,7,18,9,7,2,3,0,10,23]
calc(data)

write a program that converts a number in base 10 to its equivalent in base 2. Java write a program to calculate the factorial of any natural number entered by a user. Write a C program that accepts ten number and decide whether the number is prime. Write a program to print the first 10 Fibonacci numbers.Each Fibonacci numb Write a program that generates 4-,10-,or 20-sided dice. write a program to represent multiplication tables.用最简单的JAVA语言. Please write a Java program,compute the GreatestCommonDivisor求JAVA程序 Write a program to find all Armstrong number in the range of 100 and 999. 英语翻译1.write a program that prints its input one word per line2.write a program that initia lizes an anrray of 10 elements.Each element should be equal to its subsript.The program should then print each of the elements.3.write a program that w This computer program ______(write) in 2004 write a program to read a four digit integer and print the sum of its digits.Hint :Use / and % operators. Write a program,which performs as the following:(java)Write a program,which performs as the following:Create two interfaces Automobile and Nonautomobile.They contain abstract methods AutomobileMotionMode( ) and NonautomobileMotionMode( ).Create a Write a program that will simulate n coin tosses.After every 100 tosses print out the proportion Java write a program to read an integer,n,from the keyboard and output n row of pascal's triangle. write a program that scans the initial IbM and replaces the lowercase b with uppercase B求大神指教 Enter 10numbers from the keyboard,write a program to find the maximal number and its subscript,an 一道简单的 C语言题目 小弟在线等Write a C program that produces the following outputCounting down54321Liftoff! Write a program to append one file”1.txt” at the end of another “2.txt”.用c编