4 is 2**2

"""
Explanation: wk0.1 A curious case of conditionals
Intro to git and github
Feedback form: https://docs.google.com/forms/d/1A0rjsJUUBlQTXOpHN0wGglDEG4Mte5DorovPTS_cbsI/viewform?usp=send_form
Read these:
* https://help.github.com/articles/set-up-git/
* https://www.atlassian.com/git/tutorials/syncing/git-push
A few challenges
Complete reverse_string and primes challenges in challenge folder.
Reviewing some ideas from yesterday
While Conditional.: return discussion

Follow up on yesterday's discussion on conditionals

more on conditionals:
* is and is not
  * difference between is and ==
End of explanation
"""


# a in range(10)

assert a == 1
30 in range(10)

"""
Explanation: Try evaluating each of the lines below in your python REPL. What's going on? 
a = [1, 2, 3]
b = a
b is a
b == a
b = a[:]
b is a
b == a
If you have a hypothesis about the difference between is and ==, devise some tests you could try out to disprove your hypothesis. Implement them. Were you correct?

in and not in
End of explanation
"""


x = False
y = 0

x/y and x

"""
Explanation: and, or
End of explanation
"""


a = [1, 2, 3]
L = [4, 5, 6]

a[len(a):]


"""
Explanation: comparison priority

not has the highest priority and or the lowest, so that A and not B or C is equivalent to (A and (not B)) or C.



Short circuit operators


More string and list practice

Add elements from a list L to the end of another list at least three different ways.
End of explanation
"""


a[:4] + ['b'] + a[4:]

"""
Explanation: Insert elements into a list at least two different ways.
End of explanation
"""


str1 = "hello"
str1 = list(str1)
str1.insert(3, 'demo')
str1 = ''.join(str1)
str1

# str1 = "Hello world"
# str1 = str1[:3] + 'llllll' + str1[4:]
# str1

"""
Explanation: Insert an element into a string (this might take more than one step...).
End of explanation
"""



lst  = [1 , 2, 3, 4]
lst.remove(3)
lst

"""
Explanation: Remove an item from a list by value.
End of explanation
"""


lst.pop(0)
lst

"""
Explanation: Remove an item from a list by index.
End of explanation
"""


lst = [1, 2, 3, 4]

lst.clear()
lst

"""
Explanation: Remove all items from a list two different ways.
End of explanation
"""


lst = [1, 2, 2, 3, 4]
lst.index(2)

"""
Explanation: Return the index in the list of the first item whose value is x.
End of explanation
"""


lst.count(1)

"""
Explanation: Return the number of times x appears in the list.
End of explanation
"""


lst = [1, 2, 3]
lst.append(5)

lst

str1 ='abc'
b = list(str1).append(5)
b

"""
Explanation: Capitalize the first element in a string
End of explanation
"""


def %(duh):
    """ Append 5 to the end of the list"""
    return duh + '5'

def area(xadsf787adf, asdfjljk4):
    return xadsf787adf*asdfjljk4

foo = 7
bar = 10
area(foo, bar)

str1 = 'asdf'
#string_changer(str1)

"""
Explanation: Capitalize all elements in a string
End of explanation
"""


def namer(n, a):
    print('My name is {name} and my age is {age}'.format(age=a, name=n))
    
namer('Richie', 8)

str1.split()

"""
Explanation: Strip leading, trailing, and all whitespace (ex. leading: '  asdf  ' --> 'asdf  ', trailing:'  asdf  ' --> '  asdf', all:'   asdf   ' --> 'asdf').
End of explanation
"""


10 * (1/0)

4 + spam*3

'2' + 2

"""
Explanation: Split a sentence into a list of words (no whitespace), how would you split on comma or semi-colon?


Read up on how to format strings


Intro to pins assignment

Intro to try/except and error handling
Syntax errors vs. exceptions
End of explanation
"""


while True:
    try:
        x = int(input("Please enter a number: "))
        break
    except ValueError:
        print("Oops!  That was no valid number.  Try again...")

"""
Explanation: Handing exceptions
End of explanation
"""


