calthoff / tstp

This is an old repository for the exercises in "The Self-Taught Programmer." Please see /selftaught.
166 stars 190 forks source link

Chap 6 Challenges 3 and 4 Solutions based on chapter content #34

Open Captain-Goofy opened 4 years ago

Captain-Goofy commented 4 years ago

Challenge 3, based on chapter 6 content is as follows:

st = "aldous Huxley was born in 1894." firstLetter = st[0:1].upper() theRest = st[1:] st = firstLetter + theRest print(st)

Challenge 4

Two methods, not one, one nested in the other.

st = ("Where now? Who now? When now?".replace("? ", "?@")).split("@") print (st)