Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

except index out of range python

arr = ['a', 'b', 'c']

for i in range(4):
	try:
		print(arr[i])

	except IndexError as e:
		print(f'{e}: {i} is out of range')
 
PREVIOUS NEXT
Tagged: #index #range #python
ADD COMMENT
Topic
Name
6+4 =