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 3221238
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:51:12+00:00 2026-05-17T15:51:12+00:00

I looked in my book and in the documentation, and did this: a =

  • 0

I looked in my book and in the documentation, and did this:

a = "hello"
b = a.split(sep= ' ')
print(b)

I get an error saying split() takes no keyword arguments. What is wrong?

I want to have [‘h’,’e’,’l’,’l’,’o’]
I tried not passing sep and just a.split(‘ ‘), and got [‘hello’]

  • 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-17T15:51:12+00:00Added an answer on May 17, 2026 at 3:51 pm

    Python allows a concept called “keyword arguments”, where you tell it which parameter you’re passing in the call to the function. However, the standard split() function does not take this kind of parameter.

    To split a string into a list of characters, use list():

    >>> a = "hello"
    >>> list(a)
    ['h', 'e', 'l', 'l', 'o']
    

    As an aside, an example of keyword parameters might be:

    def foo(bar, baz=0, quux=0):
        print "bar=", bar
        print "baz=", baz
        print "quux=", quux
    

    You can call this function in a few different ways:

    foo(1, 2, 3)
    foo(1, baz=2, quux=3)
    foo(1, quux=3, baz=2)
    

    Notice how you can change the order of keyword parameters.

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

Sidebar

Related Questions

I looked at this: Returning values from nested functions in Javascript but it did
I'm a student & i looked up this function in a book. It works
I looked at this example from the C# in nutshell book ( http://www.albahari.com/nutshell/ch04.aspx )
I looked around but haven't found an answer to this. I have a CentOS
I looked around and couldn't find it! Maybe I didn't look hard enough,but this
I looked at this example http://msdn.microsoft.com/en-us/library/bb399420.aspx and clicked on DataContext.CreateDatabase which brought me to
I am baffled as to what I am doing wrong. I've looked this up
I looked at various Haskell resources on the web, before buying the book, Real
I didn't find any info on searches when I looked this up. I've been
Hello to all that read I am self learning C++ from a text book:

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.