help4code-logo
  • eLearning
    • Tutorials
    • Programs
    • Interview Questions
    • Technical Questions
    • C Language
    • C++
    • JAVA
    • HTML & CSS
    • PHP
    • AJAX
    • J2EE
    • SQL
    • jQuery
  • Go back to Home
  • Our Placements
  • Tutorials
  • Programs
  • Interview Questions
  • Technical Questions
  • Live Training
  • Our Placements
  • Associated Colleges
  • Our Recruiters
  • Back
  • C Language
  • C++
  • JAVA
  • HTML & CSS
  • PHP
  • AJAX
  • J2EE
  • SQL
  • jQuery

Programs

  1. Home
  2. Programs
  3. Python
  4. Arrays
Image

Programs - Python - Arrays

  • Programs
    • WAP to copy all elements of one array into another array
    • WAP to print the duplicate elements of an array
    • WAP to print the elements of an array
    • to print the elements of an array in reverse order
    • WAP to print the largest element in an array
    • WAP to print the smallest element in an array
    • WAP to print the number of elements present in an array
    • WAP to print the sum of all elements in an array
    • WAP to sort the elements of an array in ascending order
    • WAP to sort the elements of an array in descending order
    • WAP to split array and move first part to end

Program:

# Initialize array
arr = [1, 2, 3, 4, 2, 7, 8, 8, 3]

print("Duplicate elements in given array: ")

# Searches for duplicate element
for i in range(0, len(arr)):
for j in range(i + 1, len(arr)):
if arr[i] == arr[j]:
print(arr[j])

Output:

Duplicate elements in given array:
2
3
8
Help4Code

The help4code.com - An e-learning educational website where all computer science students can find rich collection of computer language programs which will help in exploring computer programming.

  • About
  • Associated Colleges
  • Leadership
  • Careers
  • Our Recruiters
  • Community
  • Terms
  • Privacy
  • Help
  • Press
  • Contact
  • Directory

First Floor, Plot No. 4, Near Shat Ayu College, Ring Road Nagpur, Maharashtra, India - 440022
+91 9175287066[email protected]

© Copyright 2022 help4code.com.

  • My Account
  • Sign-in
  • Sign-up