I have a userProfile text file in which the first line contains the username and password of said user. How do I print all the contents of the userProfile file except for the login details?(very first line in file.) I know how to print all of it, but how do i 'subtract' the first line?
Asked
Active
Viewed 474 times
1 Answers
-1
Read your file and ignore first line with [1:]
userlist = open(f'test.txt').readlines()[1:]
for user in userlist:
print(user)
ikibir
- 376
- 3
- 11
-
-
That doesn't really ignore the first line; it creates a copy of *all the other lines*. – chepner Dec 24 '19 at 13:45