Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #84005
| Date | 2015-01-19 17:01 +0800 |
|---|---|
| Subject | How to change the number into the same expression's string and vice versa? |
| From | contro opinion <contropinion@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.17845.1421658099.18130.python-list@python.org> (permalink) |
[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'
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
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
csiph-web