Write a Python program that creates a list containing ten random integers in the range 1 to 50. Then, create two additional lists: one contains the non-duplicate values and the other one contains the...


Write a Python program that creates a list containing ten random integers in the range 1 to 50. Then,<br>create two additional lists: one contains the non-duplicate values and the other one contains the duplicate<br>values. Print the three lists. A sample run is given below:<br>In [129]: runfile('E:/COMP2101/src/lab10_ex7NoDuplicates.py',<br>wdir='E:/COMP2101/src')<br>Original list:<br>Non-Duplicate list: [26, 24, 3, 30, 6, 13, 11, 40]<br>Duplicate list:<br>[26, 24, 3, з0, 6, 13, 11, 3, 40, 13]<br>[3, 13]<br>In [130]: runfile('E:/COMP2101/src/lab10_ex7NoDuplicates.py',<br>wdir='E:/COMP2101/src')<br>Original list:<br>Non-Duplicate list: [24, 41, 7, 37, 5, 46, 50, 10, 19, 25]<br>Duplicate list:<br>[24, 41, 7, 37, 5, 46, 50, 10, 19, 25]<br>[]<br>In [131]: runfile('E:/COMP2101/src/lab10_ex7NoDuplicates.py',<br>wdir='E:/COMP2101/src')<br>Original list:<br>Non-Duplicate list: [31, 4, 50, 26, 6, 28, 35, 1, 38]<br>Duplicate list:<br>[31, 4, 50, 26, 6, 28, 35, 31, 1, 38]<br>[31]<br>

Extracted text: Write a Python program that creates a list containing ten random integers in the range 1 to 50. Then, create two additional lists: one contains the non-duplicate values and the other one contains the duplicate values. Print the three lists. A sample run is given below: In [129]: runfile('E:/COMP2101/src/lab10_ex7NoDuplicates.py', wdir='E:/COMP2101/src') Original list: Non-Duplicate list: [26, 24, 3, 30, 6, 13, 11, 40] Duplicate list: [26, 24, 3, з0, 6, 13, 11, 3, 40, 13] [3, 13] In [130]: runfile('E:/COMP2101/src/lab10_ex7NoDuplicates.py', wdir='E:/COMP2101/src') Original list: Non-Duplicate list: [24, 41, 7, 37, 5, 46, 50, 10, 19, 25] Duplicate list: [24, 41, 7, 37, 5, 46, 50, 10, 19, 25] [] In [131]: runfile('E:/COMP2101/src/lab10_ex7NoDuplicates.py', wdir='E:/COMP2101/src') Original list: Non-Duplicate list: [31, 4, 50, 26, 6, 28, 35, 1, 38] Duplicate list: [31, 4, 50, 26, 6, 28, 35, 31, 1, 38] [31]

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here