## Welcome to HW2-2 task 2!
## Please refer to the assignment page for directions.


# Here is an  example with two break points:
a = 0
a + 5
#1-ex

a = 3
b = [max([-10, a - 4]), a + 4]
#2-ex

## The answers for the code above would look like this:
##
## 1-ex: Name, Type, Value
##  a, int, 5
##  CORRECTION: a is actually 0 since the line a + 5 doesn't actually change a
##
## 2-ex: Name, Type, Value
##  a, int, 3
##  b, list(int), [-1, 7]
##
## That's everything to this assignment. Remember that you will recieve full credit for each part
## even if you first guess was wrong as long as you correct yourself. The following code has 7
## lines where you're expected to list the variables.
##
## Also, no, you do NOT need to list the variables from the example code.


####START OF CODE YOU NEED TO EXAMINE####
names = ['Hammurabi', 'Miles', 'Joe', 'Jake', 'Jess']
count = 5
#1

names = names + ['the CIT puppy']
count + 1
#2

## sorted is a built-in function that sorts a list you give it.
sorted(names)
#3

## len is a built-in function that gives you the length of a string or list you input.
count = len(names[-1]) ## list[-1] gives you the LAST element
newString = "Spot " + names[-1]
#4

newString = "A " + newString[13:19] + "!!!"
#5

## The lines below are python if-statements
## they're very similar to if-formulas from your spreadsheets.
## The code that's indented only happens if the if-statement is true.
## So for the first example, names[0] = "Hammurabi", and names[0][0] = "H".
## The "==" asks "are the things before and after "==" the same?"
## "H" and "J" are NOT equal, which makes the if-statement false
## Since the if-statement is false, so the indented line after the if-statement does not run.

jNames = []
if names[0][0] == 'J':
    jNames = jNames + [names[0]]
if names[1][0] == 'J':
    jNames = jNames + [names[1]]
if names[2][0] == 'J':
    jNames = jNames + [names[2]]
if names[3][0] == 'J':
    jNames = jNames + [names[3]]
if names[4][0] == 'J':
    jNames = jNames + [names[4]]
if names[5][0] == 'J':
    jNames = jNames + [names[5]]
#6
