Sep-15-2021, 01:07 AM
How about this one
thislist = ["apple", "banana", "cherry", "orange", "kiwi", "melon", "mango"]
print(thislist[2:5])
My first objection - why does Python start counting with zero instead of one? Nobody starts counting with zero so it's unlogical to me.
My second objection - why is the count not include the fifth word but stops at the fourth? Yes that's the Python rule I know but I think it's unlogical, to me.
thislist = ["apple", "banana", "cherry", "orange", "kiwi", "melon", "mango"]
print(thislist[2:5])
My first objection - why does Python start counting with zero instead of one? Nobody starts counting with zero so it's unlogical to me.
My second objection - why is the count not include the fifth word but stops at the fourth? Yes that's the Python rule I know but I think it's unlogical, to me.