Weblog Archive

Command line calculator

Fri, 23 Feb 2007 at 11:31 • Chyetanya Kunte • Filed under Self

I often forget to bring my scientific calculator to work. So, more often than not, I end-up using Python’s CLI. Windows built-in calc is good, just not good enough in remembering variables previously assigned. The only trouble is that I sometimes forget to attach a module1 name like math. to a function (known as dot notation). For example,

math.sqrt(ke/Me) instead of just sqrt(ke/Me).

I need to get this in my habit of writing expressions.

Update: Type help(module) or in this case, help(math) on the CLI to see what functions the math module supports.

  1. This needs to be preceded by an import module in CLI, e.g., import math once in the session. []
[ Ads ]

Related posts

Following list is auto-generated, based on this post's context as possibly related. You may, however, occasionally find some in this list unrelated, but nevertheless, we sincerely hope that you'll enjoy them too.

Respond privately

Comments are closed, but you may respond privately to “Command line calculator.” (Your response will not be published.)