Python Program to Find the Union of two Lists

Here we will write a program in Python to find union of two lists. We will write a user defined function to enter the lists and will display the union as output.

Step-wise Solution:

1. Define a function which accepts two lists and returns the union of them.
2. Declare two empty lists and initialise to an empty list.
3. Consider a for loop to accept values for two lists.
4. Take the number of elements in the list and store it in a variable.
5. Accept the values into the list using another for loop and insert into the list.
6. Repeat 4 and 5 for the second list also.
7. Find the union of the two lists.
8. Print the union.
9. Exit.

Now lets write the code for the same.

Python Program to Find the Union of two Lists

OUTPUT:

Please comment for any suggestion or concerns.