Question

In: Computer Science

Number Analysis Program Python: Initialize an array with these specific 20 numbers: 26 45 56 12...

Number Analysis Program Python:

Initialize an array with these specific 20 numbers: 26 45 56 12 78 74 39 22 5 90 87 32 28 11 93 62 79 53 22 51

Display the following data:

1. The lowest number in the list
2. The highest number in the list
3. The total of the numbers in the list
4. The average of the numbers in the list

Solutions

Expert Solution

#source code:

numbers=[26,45,56,12,78,74,39,22,5,90,87,32,28,11,93,62,79,53,22,51]
min=numbers[0]
max=numbers[0]
sum=0
length=len(numbers)
for i in range(length):
   if(numbers[i]<min):
       min=numbers[i]
   if(numbers[i]>max):
       max=numbers[i]
   sum=sum+numbers[i]
print("The lowest number in the list:",min)
print("The highest number in the list:",max)
print("The total of the numbers in the list:",sum)
print("The average of the numbers in the list:",sum/length)

  

#output:

#if you have any doubt comment below..if you like give thumbs up...


Related Solutions

Write a Java program to initialize an array with the even integers from 2 to 20...
Write a Java program to initialize an array with the even integers from 2 to 20 and print the result then pass this array to a method in order to create a new array which is the inverse of the array you passed (print the result). You cannot use a third array. Insert comments and version control in the program to document the program.
Number Analysis Program (Specific Design Specifications) Design a Python program that asks the user to enter...
Number Analysis Program (Specific Design Specifications) Design a Python program that asks the user to enter a series of 20 numbers. The program should store the numbers in a list then display the following data: The lowest number in the list The highest number in the list The total of the numbers in the list The average of the numbers in the list This python program must include the following functions. Your program must use the exact names, parameter lists,...
Write a python program to sum the prime numbers existing in an array . For instance...
Write a python program to sum the prime numbers existing in an array . For instance , if A = [4, 7, 12, 3, 9] the output should be 10
write a program in python that insert a number in the middle of an array. Assume...
write a program in python that insert a number in the middle of an array. Assume that the length of an array is even. For instance, is a=(1,4,7,9) and num=100, then really=(1,4,100,7,9)
Write a Java program that creates an array with 20 random numbers between 1 and 100,...
Write a Java program that creates an array with 20 random numbers between 1 and 100, and passes the array to functions in order to print the array, print the array in reverse order, find the maximum element of the array, and find the minimum element of the array. The prototype of the methods: public static void printArray(int arr[]) public static void printArrayReverse(int arr[]) public static int searchMax(int arr[]) public static int searchMin(int arr[]) Sample output: Random Array: [17 67...
In Python please:  Number the Lines in a File: Create a program that adds line numbers to...
In Python please:  Number the Lines in a File: Create a program that adds line numbers to a file. The name of the input file will be read from the user, as will the name of the new file that your program will create. Each line in the output file should begin with the line number, followed by a colon and a space, followed by the line from the input file.
A Fe-56 atom (iron-56) contains 26 protons in its nucleus. Determine the number of neutrons in...
A Fe-56 atom (iron-56) contains 26 protons in its nucleus. Determine the number of neutrons in its nucleus and then calculate the nuclear binding energy per nucleon for Fe-56. The atomic mass of Fe-56 is 55.934939 u. 492 MeV 18.9 MeV 8.79 MeV 16.4 MeV 9.14 MeV
Initialize and Print an Array Write a program that accepts two integer values, called "arraySize" and...
Initialize and Print an Array Write a program that accepts two integer values, called "arraySize" and "multiplier", as user input. Create an array of integers with arraySize elements. Set each array element to the value i*multiplier, where i is the element's index. Next create two functions, called PrintForward() and PrintBackward(), that each accept two parameters: (a) the array to print, (b) the size of the array. The PrintForward() function should print each integer in the array, beginning with index 0....
Create and initialize a string array, write and use 3 functions.Write a program. Create a string...
Create and initialize a string array, write and use 3 functions.Write a program. Create a string array in the main(),called firstNameArray, initialize with7 first namesJim, Tuyet, Ann, Roberto, Crystal, Valla, Mathilda Write a first function, named searchArray, that passes two arguments: a single person’s name and the array reference, into a function,This function should then search the array to see if the name is in the firstNameArray. If found, it will return the array index where the name is found,...
Given n. Write a program in PYTHON to Generate all numbers with number of digits equal...
Given n. Write a program in PYTHON to Generate all numbers with number of digits equal to n, such that the digit to the right is greater than the left digit (ai+1 > ai). E.g. if n=3 (123,124,125,……129,234,…..789)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT