subject

Write a Python program for each of the problems in this lab. Please use PyCharm to type and test your programs. Problem 1
This program is about sets. Write a Python program to do the following:
(a) Generate 5 random integers between 1 and 10, inclusive. Store the random integers in a set named set1. Display the set. Please note that the set may have less than 5 elements because some of the random integers generated may be redundant.
(b) Generate 5 random integers between 1 and 10, inclusive. Store the random integers in another set named set2. Display the set. Please note that the set may have less than 5 elements because some of the random integers generated may be redundant.
(c) Find and display the union of set1 and set2.
(d) Use set comprehension to select odd numbers from the union and store them in a set. Display this set.
(e) Find and display the intersection of set1 and set2.
(f) Find and display the symmetric difference of set1 and set2.
The following is an example.
set1: {9, 10, 1, 7} set2: {8, 1, 7} Union of set1 and set2: {1, 7, 8, 9, 10} Odd numbers in union of seti and set2: {1, 9, 7}| Intersection of set1 and set2: {1, 7} Symmetric difference of set1 and set2: {8, 9, 10}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:30
Three out of five seniors remain undecided about a college major at the end of their senior year.
Answers: 3
question
Computers and Technology, 24.06.2019 17:50
You work in the accounting department and have been using a network drive to post excel workbook files to your file server as you complete them. when you attempt to save a workbook file to the drive, you see the error message: β€œyou do not have access to the folder β€˜j: \’. see your administrator for access to this folder.” what should you do first
Answers: 2
question
Computers and Technology, 24.06.2019 22:30
In writing a paper for his english class, gavin quoted an author of the book. what should he include in his paper to credit the source? citation caption header entry
Answers: 1
question
Computers and Technology, 25.06.2019 08:10
What refrigerant has been approved for new household refrigerators and freezers
Answers: 1
You know the right answer?
Write a Python program for each of the problems in this lab. Please use PyCharm to type and test you...
Questions
Questions on the website: 13722360