Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19700 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2012-02-01 20:48 +1100 |
| Last post | 2012-02-01 20:48 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: How can I verify if the content of a variable is a list or a string? Chris Angelico <rosuav@gmail.com> - 2012-02-01 20:48 +1100
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-02-01 20:48 +1100 |
| Subject | Re: How can I verify if the content of a variable is a list or a string? |
| Message-ID | <mailman.5293.1328089733.27778.python-list@python.org> |
On Wed, Feb 1, 2012 at 12:11 PM, Andres Soto <soto_andres@yahoo.com> wrote:
>
> okok, my mistake is that I was using string in place of str. Thank you!!
> regards
Tip: In the interactive interpreter, enter:
>>> type("spam")
<class 'str'>
In Python 2, it'll say "type" not "class", but same diff. It tells you
there what the type is.
Same can be used for any other literal, name, or other object. Can be
quite handy at times.
ChrisA
Back to top | Article view | comp.lang.python
csiph-web