+ 2
File lines question
File contains 3 rows of names. How can I print it out so it’s in ascending order of surname? Thank you and please explain For row in file: Info = row.split(“,”) Username=info[0] Firstname=info[1] Surname=info[3] Print(username, firstname, surname)
1 ответ
+ 2
You can use sort method
info.sort()
#index 3 out of range, may you mean info[2]