Changes

Jump to: navigation, search

OPS435 Python Lab 4

6 bytes removed, 23:15, 16 August 2017
Create a Python Script Demonstrating Comparing Sets
:'''Perform the Following Instructions'''
::#Create the '''~/ops435/lab4/lab4a.py''' script. The purpose of this script will be to demonstrate the different way of comparing sets. There will be three functions, each returning a different set comparison.
::#Use the following template to get started:<sourcelang="python">
#!/usr/bin/env python3
def join_sets(set1s1, set2s2): # join_sets will return a set that has every value from both set1 s1 and set2 s2 inside it
def match_sets(set1s1, set2s2): # match_sets will return a set that contains all values found in both set1 s1 and set2s2
def diff_sets(set1s1, set2s2):
# diff_sets will return a set that contains all different values which are not shared between the sets
</source>
:::*The join_sets() function should return a set that contains all values from both sets
:::*The match_sets() function should return a set that contains all values found in both sets
:::*The diff_sets() function should return a set that contains all values which are not shared between both sets
:::*The join_sets() function should return a set that contains all values from both sets
:::*All three functions should accept '''two arguments''' both are sets
:::*The script should show the exact output as the samples

Navigation menu