Problem

Frank de Bot debot at xs4all.nl
Wed May 19 14:49:23 EDT 1999


The strings are extracted from a file. (forgot to tell). Do you maybe know a way
to make the string valid to calculate with?

Aahz Maruch wrote:

> In article <3742FA52.2779E388 at xs4all.nl>,
> Frank de Bot  <debot at xs4all.nl> wrote:
> >
> >How can I calculate with string if they are numbers.
> >For example:
> >first = 20
> >second = 10
> >calc = first - second   # This doesn't work. I hope you understand what
>
> Works for me:
>
> % python
> Python 1.5.1 (#3, Jan 13 1999, 11:11:57)  [GCC 2.7.2] on sunos5
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> first = 20
> >>> second = 10
> >>> calc = first - second
> >>> calc
> 10
>
> --
>                       --- Aahz (@netcom.com)
>
> Hugs and backrubs -- I break Rule 6       <*>      http://www.rahul.net/aahz/
> Androgynous poly kinky vanilla queer het
>
> "Just because I'm selling you into slavery doesn't mean we can't be
> friends."  B-movie cliche Hall of Fame  (_Bounty Hunter: 2002_)

--
                          \\\|///
                        \\  - -  //
                         (  @ @  )
/----------------------oOOo-(_)-oOOo--------------------\
|                                                       |
|                                                       |
| My Email:  debot at xs4all.nl                            |
| Homepages: http://www.debot.nl/ppi/                   |
|            http://www.searchy.net/lyrics/             |
|            http://www.searchy.net/                    |
|                                                       |
\-------------------------------Oooo--------------------/
                        oooO    (   )
                       (   )    ) /
                       \ (     (_/
                        \_)






More information about the Python-list mailing list