I'm having some trouble importing data from a txt file into an array. Here is the information in the txt file. It is an employee list with their names (don't mind my love of Star Wars), wage per hour, and hours worked.
Darth Vader
12.50
35
Princess Leia
13.50
40
Han Solo
14.25
10
Luke Skywalker
10.55
55
Here is my code:
text_file = open("/Applications/Python 3.8/Assignment1.txt", "r")
lines = text_file.readlines()
employees = []
counter = 1
for line in lines:
print(line)
employees.append(line[:-1])
print(employees)
How do I get it so every first line is a person's name, every second is their wage, and every third is their hours worked?