Oct-21-2022, 01:14 PM
(Oct-20-2022, 04:46 AM)rob101 Wrote: As already stated, there's an error (a typo, maybe?)
This is how I would do it:
results = ['A', 'B', 'C', 'D'] for index, c in enumerate(results): if index % 2 == 0: print(*results[index:index + 2])I've used
Output:A B C Dindex
rather thani
, but it's the same thing.
HI rob101,
Is it possible to write it into a text file, instead of print?