Taking the city and the year out of a string

Write code · Basic · §2.4 Indexing and slicing

Print the first character of s, its last character, the city name before the underscore, the year after the underscore, and the whole string reversed, one per line in that order. Use indexing and slicing.

Starter code

s = "Seoul_2026"

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.