def get_score(word):
'''(str) -> int
Return the point value the word earns.
Word length: < 3: 0 points
6-9: 1 point per character in word
7-11: 2 points per character in word
10+: 3 points per character in word
>>> word_score('DRUDGERY')
16
'''
I have this homework I want some help ,to guide me from where should I begin
this my attempt
s=0
if len(word) in range (6,10)------for the second condition
for i in range (len(word)):
s=s+i
but it didnot work correctly any help please
Sarah2012
0
Newbie Poster
Recommended Answers
Jump to PostIn the future, please let give more information about how the program is failing, otherwise we won't have enough to go by.
As it happens, the answer is quite simple: the function doesn't return a value. Try adding
return s
at the end of the function and it should …
All 4 Replies
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
M.S.
53
Light Poster
M.S.
53
Light Poster
HiHe
174
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.