Can't figure out how to work with list indexes
I'm trying to reference an element in a list and return the next element in the list as a string.
But it keeps telling me it's the wrong syntax.
I've looke the syntax up too, and all I could find was to write it like this:
But I just get SyntaxError: invalid syntax
Edit: I realized my [email protected]** had forgotten a :.
Now, I instead get: TypeError: list indices must be integers or slices, not str
I don't know how to do this.
@MrVoo Oh man I forgot about that. Well that explains it.
I used similar syntax in Java so I mixed the language syntax up a bit.
Edit: Although according to w3schools.com, it's actually supposed to be possible.
Although it's meant to look for that given value in the string.