Polyglot CheatSheet - Built-in Constants/Variables/Keywords

Updated: 2018-06-26

Bash

  • $# - Denotes the number of arguments you have passed to the shell script from the command line.
  • [email protected] - All arguments, as separate words.
  • $* - All arguments, as one word.
  • $$ - ID of the current process.
  • $? - Exit status of the last command.
  • $0,$1,..$9,${10},${11}…${N} - These are positional parameters. After “9″ you must use the ${k} syntax.

Node/Javascript

  • process
  • window
  • JSON

Python

>>> import keyword
>>> keyword.kwlist
['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
>>> len(keyword.kwlist)
33

async and await will be added in 3.7