Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Index out of range error

Jim TellyJim Telly Member Posts: 1

When I run the code
f = open("test.txt", "r")
xp_levelup_save=f.readlines(3)
xp_levelup_save=[int(i.replace("\n", "")) for i in xp_levelup_save][2]
f.close()
The error "Index out of range comes out"
Here is what the text file looks like
0
1
2
3
4
5
6
Does anyone know a way to fix this error. If so how

Comments

Sign In or Register to comment.