Tagged: negative-index

Everything tagged "negative-index", newest first.

Coding Practice ·

Python Coding Exercise #57: Second and Second to Last Characters

A beginner Python exercise on string indexes and short-circuit conditions — compare the second and second to last characters of a string, and learn why a very short string needs a length check first.

Coding Practice ·

Python Coding Exercise #56: End to Beginning

A beginner Python exercise on string indexing and while loops — print a string in reverse, one character per line, by counting an index down from -1 using negative indexes.

All tags