r/learnpython • • 21h 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.

2 Upvotes

18 comments sorted by

View all comments

7

u/ninhaomah 21h ago

So... What have you done so far ?

-2

u/Next-Flounder-8998 21h 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.

4

u/fakemoose 21h ago

So share your code

Also why is all your text in bold?

3

u/Binary101010 20h ago

We can't tell you why that happened if you don't show us your code.