Syntax¶
Generated Fri 25 Jan 2019 14:49:25 UTC
Spaces¶
uPy requires spaces between literal numbers and keywords, CPy doesn’t¶
Sample code:
try:
print(eval('1and 0'))
except SyntaxError:
print('Should have worked')
try:
print(eval('1or 0'))
except SyntaxError:
print('Should have worked')
try:
print(eval('1if 1else 0'))
except SyntaxError:
print('Should have worked')
CPy output: | uPy output: |
0
1
1
|
Should have worked
Should have worked
Should have worked
|