Question: Using Python 3: Write a program that asks the user for two lists of numbers separated by commas and prints out a list of numbers

Using Python 3: Write a program that asks the user for two lists of numbers separated by commas and prints out a list of numbers that appear in both lists (no duplicates). Make sure the program works when the lists have different lengths.

Sample input/output:

Enter list 1: 3, 10, 12, -4, 20, 1000

Enter list 2: 5, 6, 3, 20, 4, 0, 10

Output: [3, 20, 10]

The input() function in Python 3 allows you to accept input from the user on the command line.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!