Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7498113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:20:38+00:00 2026-05-29T19:20:38+00:00

I feel like this is a really simple question, but I need help figuring

  • 0

I feel like this is a really simple question,
but I need help figuring out.

So, I have the following:

str = 'hello world'
str.split()  # ['hello','world']

I want to index ‘world’ but str[1] returns ‘e’, which is the second character in the list.
How do I index by word instead of character?

Please help me out and thank you in advance.

(Please don’t tell me to do str[5:]… I wanna know how to index words in general)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:20:43+00:00Added an answer on May 29, 2026 at 7:20 pm

    You need to index the result of my_str.split():

    my_str = "hello world"
    words = my_str.split()
    print words[1]
    

    (Renamed the variable to my_str to avoid shadowing the built-in.)

    Note that my_str.split() does not change my_str in any way. String objects are immutable in Python and can’t be changed. Instead, my_str.split() returns a list of strings that can be indexed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I feel like this might be really simple but I'm just not getting it
I feel like there's a simple solution to this, but I'm not really sure
I feel kind of silly asking this question as it seems really simple, but
This question seems to have been asked before, but I feel like my situation
I feel like this is a dumb question and I'm missing something, but I
I feel like this is a stupid question, but I can't think of a
This is a pretty simple question really, but let's say I'm creating a model
I have a rather simple question for you.. I feel like I should have
Disclaimer I feel like this is a fairly simple question, so i must reiterate
I feel like this is a stupid question because it seems like common sense

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.