Psst! Check what courses we have in our offer, and get them all here to save $727. Act fast–this deal is available only 3/14–3/21.
Basic utility functions
2. The len() function
Basic manipulation functions
Replacing and splitting


Let's get started. One string function you probably already know is len(). It returns the length of the string—i.e., the number of characters in it.

joke = 'Why does Python live on land? Because it is above C level!'

The code above will print 58, which is the length of the joke string.


Keep asking the user to provide a username until the input is at least 8 characters long:

Provide a username with a minimum of 8 characters:

When you get a correct username, print:

Thank you!

Stuck? Here's a hint!

Use a while loop to repeat your code as long as len(username) < 8.