Skip to main content

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.

Answer

Exercise 2:

Create an array of 10 integers. Find and print the maximum and minimum values in the array.

Answer

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.

Answer


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.

Answer


Exercise 5:

Write a program to reverse the elements of an array.

Answer

Exercise 6:

Create an array of 8 integers. Shift all elements of the array to the right by two positions. Print the modified array.

Answer

Exercise 7:

Write a program that takes an array of integers as input. Find and print the count of even numbers in the array.

Answer


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.

Answer

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).

Answer

Exercise 10:

Write a program that takes an array of integers and removes all duplicate elements. Print the modified array.

Answer

Comments

Popular posts from this blog

Dear Students Welcome to my blog.  It is to inform you that. now you can download your 10th class Computer Science book in PDF. Share with your other students.  Kindly Share your comments on my blog to support me.                                                                                   Download

Class X Test / Model Paper Chapter No 1 Computer

                                                                                Subject: Computer Science                                          Class: -10                                        Date: 4 Jan 2023 Test   # 1   Short Test (MCQs=6, SQs=8, LQs=1)     ...

Inter Board Karachi Guess/Model Papers 2023 (1st year & 2nd year)

  Inter Board Karachi Guess/Model Papers 2023 Board Karachi Model Papers 2023 Computer's Guess Paper 9th Class 2023 Computer's Guess Paper 9th Class 2026 Computer's Guess Paper  10th Class 2023 Computer's Guess Paper 11th Class 2023 Computer's Guess Paper  12th Class 2023 Prepared By Sir Rana Arsalan Inter Part-I Model Papers Inter Part-II Model Papers Model Paper Mathematics I Model Paper Mathematics II Model Paper Islamiat Model Paper Urdu II Model Paper Urdu I Model Paper Pakistan Studies Model Paper Botany I Model Paper Botany II Model Paper Chem I — MCQs Model Paper Chem II — MCQs Model Paper Physics I Model Paper Physics II Model Paper Zoology I Model Paper Zoology II Model Paper English I Model Paper English II