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

  • Home
  • SEARCH
  • 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 3339898
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:32:44+00:00 2026-05-18T00:32:44+00:00

As an exercise, describe the relationship between string.join(string.split(song)) and song . (they both refer

  • 0

As an exercise, describe the relationship

between string.join(string.split(song)) and song.

(they both refer to a string)

Are they the same for all strings? When would they be different?

I am a little ashamed to ask such a question for a likely simple question but,

I don’t get it, what is/are the exception(s)? when are they are different?

  • 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-18T00:32:44+00:00Added an answer on May 18, 2026 at 12:32 am

    By default the split method groups consecutive delimiters together, so if you have them in your original string they’ll be lost:

    >>> import string
    >>> song = "I     am      the      Walrus"
    >>> string.join(string.split(song))
    'I am the Walrus'
    

    However, if you specify delimiters to split on then consecutive delimiters are not grouped so you can keep the strings the same:

    >>> string.join(string.split(song,' '))
    'I   am    the    Walrus'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The exercise says: Create a Text class that contains a string object to hold
I would like, if for no other reason that an academic exercise, to be
As security tightening exercise, I'm removing all system privileges from an oracle database user.
I was trying an exercise where I would add 1000 elements to an arraylist
Exercise: There's too much repetition in this file. Use strings, formats, and escapes to
Was completing the pine exercise for Def Grandma and thought would try and take
As an exercise, I've been trying out various ways of generating all permutations of
As an exercise, I would like to port some of the functionality of a
Here is an exercise: Either prove the following or give a counterexample: (a) Is
How do I exercise an action to ensure it redirects to the correct action

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.