I have a List e.g.:
Name - Seconds: 3.14 - Mistakes: 0
DsO - Seconds: 7.09 - Mistakes: 0
Xardas - Seconds: 7.24 - Mistakes: 0
Badudu1 - Seconds: 13.55 - Mistakes: 1
How can I sort it by seconds?
So the user types in his name which is the first entry before the " - "
I tried it with this:
seconds_position = len(user_input) + len(" - Seconds: ")
seconds = substring[seconds_position]
seconds = seconds.partition(" ")[0]
I guess that I could just do this for every list entry and compare them but how do I compare it when the seconds are two-digit before the comma?