[Python] what's wrong with the way I am splitting a string in python?

Discussão em 'Python' iniciado por Stack, Maio 30, 2025.

  1. Stack

    Stack Membro Participativo

    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']

    Continue reading...

Compartilhe esta Página