#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ENGG1811 Lecture Week 02 Demonstration on how to use line continuation """ # Implicit continuation # Code within [], (), {} are considered to be one line load_1 = [0, 1650, 3400, 5200, 6850, 7750, 8650, 9300, 10100, 10400, 10700, 10800, 10900] # A long line of code is hard to read load_2 = [0, 1650, 3400, 5200, 6850, 7750, 8650, 9300, 10100, 10400, 10700, 10800, 10900] # %% # You can use \ to connect multiple lines # Import note: \ must not be followed by any blank spaces, # otherwise Python will complain x_1 = 1234567890 + 2345678901 + 3456789012 + \ 4567890123 + 5678901234 + 6789012345 + \ 7890123456 + 8901234567 + 9012345679 # A long line of code is hard to read # Should use line continuation x_2 = 1234567890 + 2345678901 + 3456789012 + 4567890123 + 5678901234 + 6789012345 + 7890123456 + 8901234567 + 9012345679