#๐ strings method not working
19 messages ยท Page 1 of 1 (latest)
@strange valve
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.
define not working
when i put ".split" it doesnt light up yellow, which implies it it a string method. it stays white
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
it doesn't have to light up in your editor in order for the code to work
you either ignore it and it doesn't change color.
or you annotate the function
ok i be back if anything , thnks guys
def validate_url(url:str):
pass```
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
note that the interpreter doesn't enforce this. Nothing stops you from passing a non-str
^
thanks guys i got it :))
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.