Lecture 1 Finger Exercise
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
For example: Hint:
Consider using type conversions between erised is accessible to you, and that it's bound to a positive int (i.e., greater than zero).
Print the digits of that int in reverse order, consecutively on a single line, but without any leading zeros.
erised = 6, your code should print 6.erised = 742, your code should print 247.erised = 1800, your code should print 81.erised = 15006, your code should print 60051.int and str, and also using str slicing.
You may assume Hint:
Consider using the text and clip are accessible to you, each bound to a separate str.
Determine the starting index location of the third appearance of clip within text, and print a message of the form shown in these examples:
text = "cat cat dog cat dog", and clip = "cat", your code should print:
The third appearance of cat is at index 12.
text = "gogogadget goggles", and clip = "og", your code should print:
The third appearance of og is at index 12.
clip contains only letters, and that there are at least three non-overlapping appearances ofclip within text.find() method of str objects.
This method is documented in this section of the Python docs.