slice_demo(s) that returns a dictionary with five keys computed purely via slicing: "first3" (first 3 characters), "last3" (last 3 characters), "middle" (everything except the first and last 2 characters), "reversed" (the whole string reversed), and "every_other" (every second character, starting from index 0).s = 'DataVix2026'
{'first3': 'Dat', 'last3': '026', 'middle': 'taVix20', 'reversed': '6202xiVataD', 'every_other': 'DtVx06'}Each key is produced by a different slice expression on the same 11-character string.
s[:3], s[-3:], s[2:-2], s[::-1], s[::2] cover all five.