ubuntu2004
Kernel: Python 3 (system-wide)
All of the following exercises use the string "The Chimpanzees of Gombe" stored in the variable title
.
In [2]:
Exercise 6.1
Print the characters at indicies 10, and -2 in the string.
Print the first, and last characters in the string.
In [6]:
Out[6]:
n
b
T
e
Exercise 6.2
Print the characters from indicies 4 to 13 inclusive in the string.
Print the 20th to the last characters in the string.
In [11]:
Out[11]:
Chimpanze
ombe
Exercise 6.3
Print every other character in the string.
Print the reverse of the string.
In [12]:
Out[12]:
TeCipneso ob
ebmoG fo seeznapmihC ehT