Support
Quality
Security
License
Reuse
kandi has reviewed fuzzywuzzy and discovered the below as its top functions. This is intended to give you an instant insight into fuzzywuzzy implemented functionality, and help decide if they suit your requirements.
Get all kandi verified functions for this library.
Get all kandi verified functions for this library.
Fuzzy String Matching in Python
See all related Code Snippets
QUESTION
check if the string equals the first letters of a list of words
Asked 2022-Mar-28 at 14:59I am confused about a simple task
the user will give me a string and my program will check if this string equals the first letters of a list of words ( like this example)
>>> html_attr = ["onerror","onload"]
>>> example_task(html_attr,"on")
["onerror","onload"]
>>> example_task(html_attr,"one")
["onerror"]
should I use fuzzywuzzy here or what ?
thanks
ANSWER
Answered 2022-Mar-28 at 14:59No need for some weird libraries, Python has a nice builtin str function called startswith
that does just that.
def example_task(words, beginning):
return [w for w in words if w.startswith(beginning)]
Fuzzywuzzy would come in handy if you don't want an exact match.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
See Similar Libraries in
Save this library and start creating your kit
Open Weaver – Develop Applications Faster with Open Source