r/learnpython • • 25m ago

need help with this lab

Write a program that will combine two integer arrays into one larger array and remove any duplicate values.
Prompt the user for a number N, (N will be a positive integer greater than 1), then create two arrays each with N elements. Next, populate both arrays with random numbers between 0 and
500. Finally combine the two arrays into a third array making sure that only distinct values are added. I.e. if the number '65' exists in both arrays, only one instance of it will be added to the third array.
Your program should output contents of the third array, one number per line.
Before you hand it in, make sure to test your program with an A value of:
• 10
25
50
Input:
N: 25
Output:
The contents of the final array, one number per line.

4 Upvotes

8 comments sorted by

View all comments

Show parent comment

•

u/Next-Flounder-8998 17m ago

i have it done but my professor was saying that my third array removed both duplicates instead of only one of them or something along those lines i can’t remember exactly what he said but it was something with the outcome of my third array and duplicates.

•

u/fakemoose 15m ago

So share your code

Also why is all your text in bold?