#๐Ÿ”’ strings method not working

19 messages ยท Page 1 of 1 (latest)

strange valve
#

why is my string not working , is there something i am doing wrong ๐Ÿ˜ฆ

naive obsidianBOT
#

@strange valve

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

strange valve
#

when i put ".split" it doesnt light up yellow, which implies it it a string method. it stays white

echo wyvern
#

because the type of url is unknown

#

(and that's why i like type annotations)

strange valve
#

so i have to complete my code before it can be requested?

#

this is a dumb class im taking that is a intro to python and the book does not follow with the labs, so i have been struggglingggg

plucky kindle
#

it doesn't have to light up in your editor in order for the code to work

echo wyvern
#

you either ignore it and it doesn't change color.
or you annotate the function

strange valve
#

ok i be back if anything , thnks guys

kind forum
#

adding the :str after parameter url tells your editor that it's expecting a string

#

therefore you can see string's methods such as split

devout hatch
#

note that the interpreter doesn't enforce this. Nothing stops you from passing a non-str

kind forum
#

^

strange valve
#

thanks guys i got it :))

naive obsidianBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.