Chapters
Python114 chapters

Exercises

Slicing

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

Exercise 1

Print the file extension without the dot, using a slice.

Python
filename = "report.pdf"
# print pdf
Exercise 2

Print the word reversed.

Python
word = "stressed"
# print it backwards
Exercise 3

Print every second letter, starting from the first.

Python
letters = "abcdefgh"
# print aceg