Aish, in my code they feel the same! You use square brackets and slices like my_basket[2:5] whether it's a list of patterns or a string of 'kynjai'. But the difference is what you get back: slicing a string gives you another string, while slicing a list gives you a new list. I learned this the hard way yesterday, trying to swap a 'ri' (a decorative knot pattern) in a list of design names and mixing up my types when the site’s menu broke!
#exams#study
Jump in to reply — no account needed.