Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting a single-element list to a number

Status
Not open for further replies.

varocho

Programmer
Dec 4, 2000
238
US
Anyone know how to convert a single-element list to a number?
 
Maybe. Please explain a bit more what you are trying to do.
 
I figured it out, I was using the wrong syntax.

If 'listObj' is a list object, then this

listObj[0:1]

, an example of 'slicing' the list, returns the first element as another list. But this

listObj[0]

, an example of indexing the list, returns the first element as an object of whatever type it has.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top