The course uses Python version 3.5.10, which is no longer supported. I wish MITx would update it to later versions.
Problem set 2 starts getting harder, but still manageable.
I find this recursive solution to the Towers of Hanoi is the most elegant solution.
Even when my code passes the tests, most of the times, I can learn a lot from the solutions. However, I could not find solutions for problems in problem set 2.
My code | Solution | |
---|---|---|
Using min() |
if a > b: testValue = b else: testValue = a |
testValue = min(a, b) |
Using floor division |
midIndex = int (len(aStr)/2) | midIndex = len(aStr)//2 |
Tupples and Lists. Problem set 3 place holder.
placeholder
Smart slicing
My code | Solution | |
---|---|---|
Using slicing |
while i < length oddTuples = oddTuples + (aTup[i], ) i += 2 return oddTuples |
return aTup[::2] |
I managed to get my Certificate, I am very happy that I got there, a bit sad that my grade wasn't shown on the
MITx 6.00.1x Certificate