(Apr-23-2017, 08:29 PM)idontreallywolf Wrote:I usually try to be polite - but since I'm a(Apr-23-2017, 07:06 PM)volcano63 Wrote: And if the first name shows more than once in the first list? We have a beautifulzip
for meshing lists
for first_name, last_name in zip(fristName, lastName):I am not sure if 2 lists were a given - or it's OPs idea, but usingdict
the way you suggested here is definitely wrong
Well, then educate me brother. Why is using dict wrong? - in this case.
brother
, let me treat you like a family . You gave a useless advice, that adds nothing to the solution.
- For starters,
dict
has unique keys - thus my hint about more than once, which you missed.
- Suggesting manually writing dictionary instead of two lists has no merit - OP could have written full name from the start.
- You cant apply
int
tolist
slice - and why are you creating a list of strings if you want to sort it by integer component?
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.