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


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

Re: How can I verify if the content of a variable is a list or a string?

Started byChris Angelico <rosuav@gmail.com>
First post2012-02-01 20:48 +1100
Last post2012-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.


Contents

  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

#19700 — Re: How can I verify if the content of a variable is a list or a string?

FromChris Angelico <rosuav@gmail.com>
Date2012-02-01 20:48 +1100
SubjectRe: 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

[toc] | [standalone]


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


csiph-web