Slip and Slide


I was able to complete this lesson by looking at pass answers from other members and the directions were not very clear. I never had

mask = 0b1 << (n-1)

in my original code. However, after seeing many different people with a similar line of code i knew I was off. I just want to know how they interpreted this from the directions since i couldn't decipher this from the given text.


Recall that bit-1 is zero-shift left from the right (lowest order bit). That is why we subtract 1 from n, so we don't exaggerate our left shift. If we wish to flip bit-1. the mask will be,

mask = 0b1 << 0

Shifting and indexing have similar offset intuition.

'text'[0]  == 't'

Zero offset, just as above.


Thank you very much

A student from Center for Creative Arts


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.