Chapters
Python114 chapters

Exercises

Strings

3 tasks. Write the code, press Check, and the page runs it against a real Python interpreter.

Exercise 1

Print the number of characters in the word, then its first and last characters.

Python
word = "python"
# print the length, the first character, the last character
Exercise 2

Check whether quick appears in the sentence, ignoring case. Print True.

Python
sentence = "The Quick brown fox"
# print whether quick is in it, ignoring case
Exercise 3

upper() does not change the original. Make word actually hold the uppercase version.

Python
word = "python"
word.upper()
print(word)