Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/python-wasm
Path: blob/main/python/pylang/test/newlines.py
1396 views
1
# Obviously do NOT run autoformatting on this! If you do, it defeats
2
# the point of all the tests.
3
4
a = 1 + \
5
2 + \
6
3
7
assert a == 6
8
9
a = (1 +
10
2 +
11
3 +
12
4)
13
14
assert a == 10
15
16
a = (1,
17
2,
18
3,
19
4)
20
21
assert sum(a) == 10
22
23
a = [1,
24
2,
25
3]
26
27
assert sum(a) == 6
28
29
a = """
30
abc"""
31
32
assert a == '\nabc'
33
34
a = '''
35
abc'''
36
37
assert a == '\nabc'
38
39
40
a = {'x':10,
41
'y':15}
42
43
assert str(a) == "{'x': 10, 'y': 15}"
44
45
from math import (sin,
46
cos,
47
pi)
48
assert sin(0) + cos(pi) == -1.0
49
50