Feedback form: https://docs.google.com/forms/d/1A0rjsJUUBlQTXOpHN0wGglDEG4Mte5DorovPTS_cbsI/viewform?usp=send_form
Read these:
Complete reverse_string and primes challenges in challenge folder.
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?
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
In [ ]:
10 * (1/0)
In [ ]:
4 + spam*3
In [ ]:
'2' + 2
Handing exceptions
In [ ]:
while True:
try:
x = int(input("Please enter a number: "))
break
except ValueError:
print("Oops! That was no valid number. Try again...")