Python Import Array Exercises
Exercise 1:
Write a program that takes five integers from the user, stores them in an array, and then prints the sum of these integers.
Exercise 2:
Create an array of 10 integers. Find and print the maximum and minimum values in the array.
Exercise 3:
Write a program that takes an integer input from the user and creates an array with that many random integers. Print the array and calculate the average of the numbers in the array.
Exercise 4:
Create two arrays of the same size. Take integer inputs from the user to fill both arrays. Perform element-wise addition of the arrays and print the resulting array.
Exercise 5:
Write a program to reverse the elements of an array.
Exercise 6:
Create an array of 8 integers. Shift all elements of the array to the right by two positions. Print the modified array.
Exercise 7:
Write a program that takes an array of integers as input. Find and print the count of even numbers in the array.
Exercise 8:
Create an array of 12 integers representing the months of the year. Ask the user to enter a month number (1 for January, 2 for February, etc.) and print the corresponding month.
Exercise 9:
Write a program that takes two arrays of integers and checks if they are equal (have the same elements in the same order).
Exercise 10:
Write a program that takes an array of integers and removes all duplicate elements. Print the modified array.
Comments
Post a Comment
If you have any doubts, Please let me know .