Practice: String Methods

« Read the chapter

Q21. Normalise a username

IntermediateApplication

Clean the text " AdMiN " so that it is trimmed and in lower case, then print it.

Goal: Clean input.

Q22. Count words

IntermediateApplication

Print the number of words in "the quick brown fox".

Goal: Count words.

Q23. Check a PIN

AdvancedApplication

Print True if the text "4821" is exactly 4 characters long and all digits.

Goal: Validate input.