Oct-25-2016, 10:29 PM
Instead of "print(some_list)", try "for item in some_list: print(item)". Or perhaps "print('\n'.join(some_list))".
And now that that question is answered, here's a few tips on making that small snippet better:
1) Instead of "some_list = list()", try "some_list = []"
2) Instead of "for ndx in range(len(some_list)):", try "for item in some_list:"
3) Instead of "some_list = list(); some_list.append(some_thing)", try "some_list = [some_thing]"
Small little improvements to readability would go miles to helping other people quickly see what's going on in your code.
And now that that question is answered, here's a few tips on making that small snippet better:
1) Instead of "some_list = list()", try "some_list = []"
2) Instead of "for ndx in range(len(some_list)):", try "for item in some_list:"
3) Instead of "some_list = list(); some_list.append(some_thing)", try "some_list = [some_thing]"
Small little improvements to readability would go miles to helping other people quickly see what's going on in your code.