A slice that is off by one
Predict the output · Medium · §2.4, §2.7 [Pair coding with AI] Asking for string code
This code tries to take out the year 2026. Predict the two lines of output without running the code.
Code
s = "Seoul_2026"
print(s[6:9])
print(s[6:10])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.