I wrote a shell function, intended to be compatible with both zsh and bash:
py () { python -c 'print($1)'; }
but when i use py hello, I get an error from the Python interpreter:
➜ ~ py hello
File "<string>", line 1
print($1)
^
SyntaxError: invalid syntax
What am I doing wrong? Thanks!