15,918,889 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by nate walter (Top 7 by date)
nate walter
4-Nov-21 14:56pm
View
Yeah, I didn't know that
nate walter
4-Nov-21 13:51pm
View
The list is named list_name. It's full of strings. When I run
second_longest = sorted(list_name.split(), key=len)[-2]
I get – AttributeError: 'list' object has no attribute 'split'
When I run
second_longest = sorted(list_name, key=len)[-2]
I get the second longest word returned from the list as desired
nate walter
4-Nov-21 12:22pm
View
That seems to be for a string. I changed it to include the list name in place of "sentence.split" and it did, indeed work @Richard MacCutchan. So the solution looks like:
second_longest = sorted(list_name, key=len)[-2]
nate walter
3-Nov-21 13:31pm
View
If you'd like to post this as a response I'd be more than happy @ Richard MacCuthan
nate walter
3-Nov-21 13:29pm
View
Deleted
import nltk
nltk.download('words')
from nltk.corpus import words
word_list = words.words()
print(len(word_list))
# prints 236736
word_list = word_list
pattern = 'epfdoctlz'
def snellen_words(pattern):
for word in word_list:
find = True
for letter in word:
if letter not in pattern:
find = False
break
if find == True and len(word) > 1:
print(F'The letters of {word} are all in {pattern}')
snellen_words(pattern)
nate walter
3-Nov-21 13:28pm
View
This seems to work the best out of anything so far.
nate walter
3-Nov-21 11:38am
View
@Richard MacCuthan Yeah, it's just I'm not sure how to do that in Python language.
Show More