Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def check_sets(set_A, set_B):
- if set_A == set_B:
- return "Both sets are equal."
- elif len(set_A) == len(set_B):
- return "Both sets are not equal but equivalent."
- else:
- return "Both sets are not equal and equivalent."
- def input_value_set(prompt):
- while True:
- values = input(prompt).split()
- if len(values) > 5:
- print("Maximum is 5 elements! Please try again.")
- else:
- return set(map(int, values))
- set_A = input_value_set("Enter SET A values: ")
- set_B = input_value_set("Enter SET B values: ")
- print(f"""
- A = {set_A}
- B = {set_B}
- {check_sets(set_A, set_B)}
- """)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement