$ pythonPython 2.7.16 (default, Oct 10 2019, 22:02:15)[GCC 8.3.0] on linux2Type "help", "copyright", "credits" or "license" for more information.>>>
$ pythonPython 2.7.16 (default, Oct 10 2019, 22:02:15)[GCC 8.3.0] on linux2Type "help", "copyright", "credits" or "license" for more information.>>>
$ pythonPython 2.7.16 (default, Oct 10 2019, 22:02:15)[GCC 8.3.0] on linux2Type "help", "copyright", "credits" or "license" for more information.>>>
>>> quitUse quit() or Ctrl-D (i.e. EOF) to exit>>> exitUse exit() or Ctrl-D (i.e. EOF) to exit
$ python3Python 3.7.3 (default, Jul 25 2020, 13:03:44)[GCC 8.3.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>>
>>> helpType help() for interactive help, or help(object) for help about object.
>>> help()Welcome to Python 3.7's help utility!If this is your first time using Python, you should definitely check outthe tutorial on the Internet at https://docs.python.org/3.7/tutorial/.Enter the name of any module, keyword, or topic to get help on writing
help() — press Ctrl+Dhelp>You are now leaving help and returning to the Python interpreter.If you want to ask for help on a particular object directly from theinterpreter, you can type "help(object)". Executing "help('string')"has the same effect as typing a particular string at the help> prompt.>>>
>>> 2*24
>>> 2*24>>> 2*4+(3/5)**28.36
>>> help(*)File "", line 1 help(*)^SyntaxError: invalid syntax
help() expects stringString must be enclosed with quotation marks
'string'"string"
>>> help('*')Operator precedence*******************The following table summarizes the operator precedence in Python, from[ skipped ]:
>>> counter = 42>>> print("I've already wrote", counter, 'programs')I've already wrote 42 programs
Now we can execute it
$ python3 program-counter.pyI've already wrote 42 programs
$ python3 program-counter.pyI've already wrote 42 programs
Search for Python interpreter
$ which python3/usr/bin/python3
Add shebang line as first line of your file
#!/usr/bin/python3counter = 42print("I've already wrote", counter, 'programs')
Make your program executable
$ chmod +x program-counter.py
Now you can run it
$ ./program-counter.pyI've already wrote 42 programs
help()