-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathline_continuation.py
More file actions
39 lines (32 loc) · 1.03 KB
/
Copy pathline_continuation.py
File metadata and controls
39 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
gross_wages = 125000
taxable_interest = 6000
dividends = 500
qualified_dividends = 0
ira_deduction = 6000
student_loan_interest = 10000
# this is a long line: it is over 100 characters long
income = gross_wages + taxable_interest + (dividends - qualified_dividends) - ira_deduction - student_loan_interest
# same line wrapped over several lines using backslash
income2 = gross_wages \
+ taxable_interest \
+ (dividends - qualified_dividends) \
- ira_deduction \
- student_loan_interest
assert income == income2
# check this out:
x = 10
y = (10)
assert x == y
# same line can be wrapped in parenthesis
income = (gross_wages +
taxable_interest +
(dividends - qualified_dividends) -
ira_deduction -
student_loan_interest)
# the preferred approach is to break the
# line before the mathematical operators
income = (gross_wages
+ taxable_interest
+ (dividends - qualified_dividends)
- ira_deduction
- student_loan_interest)