[Tutor] Typing Equations-A Newbie

D-Man dsh8290@rit.edu
Wed, 14 Mar 2001 13:39:47 -0500


On Wed, Mar 14, 2001 at 09:01:11AM -0800, DavidCraig@pia.ca.gov wrote:

| How do I type formulas using superscripts/subscripts into Idle?

superscripts refer to exponentiation (powers).  That can be typed as,
ex:

x**y

>>> x = 10
>>> y = 2
>>> x**y
100

(I think the ** operator was introduced in 2.0, if you only have 1.5.2
use the pow() function in math)

>>> x = 10
>>> y = 2
>>> x**y
100

(I think the ** operator was introduced in 2.0, if you only have 1.5.2
use the pow() function in math)

>>> x = 10
>>> y = 2
>>> x**y
100

(I think the ** operator was introduced in 2.0, if you only have 1.5.2
use the pow() function in math)

>>> x = 10
>>> y = 2
>>> x**y
100

(I think the ** operator was introduced in 2.0, if you only have 1.5.2
use the pow() function in math)

>>> x = 10
>>> y = 2
>>> x**y
100

(I think the ** operator was introduced in 2.0, if you only have 1.5.2
use the pow() function in math)

>>> x = 10
>>> y = 2
>>> x**y
100

(I think the ** operator was introduced in 2.0, if you only have 1.5.2
use the pow() function in math)

>>> x = 10
>>> y = 2
>>> x**y
100

(I think the ** operator was introduced in 2.0, if you only have 1.5.2
use the pow() function in math)

>>> x = 10
>>> y = 2
>>> x**y
100

(I think the ** operator was introduced in 2.0, if you only have 1.5.2
use the pow() function in math)

>>> x = 10
>>> y = 2
>>> x**y
100

(I think the ** operator was introduced in 2.0, if you only have 1.5.2
use the pow() function in math)

>>> import math
>>> x = 10
>>> y = 2
>>> pow( x , y )
100


Subscripts are used only to give a different name to a variable of the
same name.  Just use a different name.  For example:

x1**y1 + x2**y2

>>> x1 = 10
>>> y1 = 2
>>> x2 = 20
>>> y2 = 4
>>> x1**y1 + x2**y2
160100


| I have tried importing them from MS Word to no avail.  Current Platform is
| WIN 98.

MS Word formulas exist only to look pretty.  They have no
functionality at all.  That's why "importing" them doesn't work.  ;-)


Basically you need to understand what the formula is trying to tell
you.  Then write that same mathematical operation using Python's
grammar and math operations.

If you are simply trying to use python as a calculator, then just
write the numeric constants in instead of first assigning them to a
variable name and then using that name.

HTH,
-D