How to write multi-line commands in Python? You can use front slash (\) to add a linebreak in a long Python command as shown in the below example – Default a = [1,2,3,4,5,\ 6,7,8] for i \ in a: print(i) 123456 a = [1,2,3,4,5,\ 6,7,8] for i \ in a: print(i) Tags: FAQ, Python