Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #84005 > unrolled thread

How to change the number into the same expression's string and vice versa?

Started bycontro opinion <contropinion@gmail.com>
First post2015-01-19 17:01 +0800
Last post2015-01-19 17:01 +0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  How to change the number into the same expression's string and vice versa? contro opinion <contropinion@gmail.com> - 2015-01-19 17:01 +0800

#84005 — How to change the number into the same expression's string and vice versa?

Fromcontro opinion <contropinion@gmail.com>
Date2015-01-19 17:01 +0800
SubjectHow to change the number into the same expression's string and vice versa?
Message-ID<mailman.17845.1421658099.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

In the python3 console:

    >>> a=18
    >>> b='18'
    >>> str(a) == b
    True
    >>> int(b) == a
    True


Now how to change a1,a2,a3  into b1,b2,b3 and vice versa?
a1=0xf4
a2=0o36
a3=011

b1='0xf4'
b2='0o36'
b3='011'

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web