Jan-28-2021, 05:01 PM
(Jan-13-2021, 08:18 PM)buran Wrote:for idx, device in enumerate(devices, start=1): print(f'{idx: >2d}.{device.part_no}') user_choice = int(input(f'Select device (1-{len(devices)}): ')) - 1
I'm going through the various replies and solutions bit by bit (I want understand what each bit does, rather than just copy/paste and say "yee ha!" it works...)
From the namedtuple solution from @buran - I pretty much get what each bit does, except >2d. I even removed : >2d from the script, ran it and it worked pretty much the same.
What does the : >2d bit do?