-
-
Save JeffersGlass/e2ceed37a5b459304216389328854e87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myList = ['a', 'b', 'c', 'd', 'e'] | |
#Throws TypeError: list indices must be integers or slices, no float: | |
print (myList[4/2]) | |
#Works fine: | |
print (myList[int(4/2)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment