# Arup Guha
# 2/1/2025
# Use of sets and maps in Python.

# Create set.
items = set()

# Add one item.
items.add(4)
print(items)

# Add several.
for i in range(12):
    items.add(i)
print(items)

# Remove an item. This crashes if the item you are trying to remove
# isn't in the set.
items.remove(6)
print(items)

# Testing if an item is in a set or not.
x = int(input("enter number\n"))
if x in items:
    print("Your number was in the set")
else:
    print("Your number wasn't in the set.")

# How to create a dictionary.
votes = {}

# Get some input.
print("Please enter names of each vote, all on one line.")
toks = input().split()

# Go through votes.
for x in toks:

    # Already there, add 1.
    if x in votes:
        votes[x] += 1

    # Add new entry.
    else:
        votes[x] = 1

# Print out vote list.
for x in votes:
    print(x, votes[x])

# Remove an item. Please enter harold above if you want to trigger the if.
if "harold" in votes:
    del votes["harold"]

print("Now, harold is gone!")

# Print out vote list.
for x in votes:
    print(x, votes[x])
