## IT 117: Intermediate Scripting Class 8 Exercise

• Run an SSH client
Run putty.exe if you have a PC or Terminal if you have a Mac.

### Create a directory for this exercise

• Go to your home directory
`cd`
• Go to your it117 directory
`cd  it117`
• Go to your ex directory
`cd ex`
• Make sure you are in your ex directory
`pwd`
• Create a directory for this exercise
`mkdir  ex8`
• Check that the directory was created
`ls`
• Go to this new directory
`    cd ex8`

### Script for this exercise

• Create the script ex8.py
`nano  ex8.py`
• Enter the following text into the script file
• Make this script executable
`chmod  755 ex8.py`
• Run this script
`./ex8.py`
• You should see
```one
three
two
five
four
number_names: {'one', 'three', 'two', 'five', 'four'}
integers:     {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
odds:         {1, 3, 5, 9, 7}
evens:        {8, 2, 10, 4, 6}

The size of number_names is 5
The size of integers is 10
The size of odds is 5
The size of evens is 5

odds.union(evens): {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
evens.union(odds): {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
odds | evens :     {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
evens | odds :     {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

odds.intersection(evens): set()
evens.intersection(odds): set()
odds & evens :            set()
evens & odds :            set()

odds_evens.intersection(evens): {8, 2, 10, 4, 6}
odds_evens.intersection(odds):  {1, 3, 5, 9, 7}```