mirror of
https://github.com/chubin/cheat.sheets
synced 2024-11-19 03:25:44 +00:00
14 lines
143 B
Plaintext
14 lines
143 B
Plaintext
|
# Basic
|
||
|
if x > 0:
|
||
|
print(x)
|
||
|
else:
|
||
|
print(-x)
|
||
|
|
||
|
# if else
|
||
|
if x > 0:
|
||
|
print(x)
|
||
|
elif x == 0:
|
||
|
print(420)
|
||
|
else:
|
||
|
print(-x)
|