Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # read data
- STUDENT_DATA = open("student_data.txt", "r")
- def Organize():
- line_list = []
- lines = 0
- for line in STUDENT_DATA:
- # make a list with each line
- line_list.append(line)
- lines = lines + 1
- # Counter init
- # count = 1
- for i in range(0, int(lines/10)):
- line = line_list[0].split('|')
- first_name = line[0].ljust(15)
- last_name = line[1].ljust(15)
- DOB = line[2].ljust(25)
- email = line[3].strip('\n')
- print('\n' + first_name, last_name, DOB, email)
- print('-' * 90)
- # here is where I am trying to slice into
- for line in line_list[1:11]:
- line = line.split('|')
- first_name = line[0].ljust(15)
- last_name = line[1].ljust(15)
- DOB = line[2].ljust(25)
- email = line[3].strip('\n')
- # trying to make a counter to slice into the list
- # count = count + 10
- print(first_name, last_name, DOB, email)
- Organize()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement