Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Python string question?

I have a string variable.

How can I get certain characters from it?

Such as:

VarStr(char)

1 Answer

Relevance
  • 9 years ago
    Favorite Answer

    Python strings are a subclass of list, so you can just use it like an array of characters. Example:

    myString = "Hello World!"

    print(myString[3])

    #prints 'l'

Still have questions? Get your answers by asking now.