Skip to content

Commit b80bef8

Browse files
style: format code with autopep8
Format code with autopep8 This commit fixes the style issues introduced in cb731cf according to the output from Autopep8. Details: https://app.deepsource.com/gh/avinashkranjan/Amazing-Python-Scripts/transform/1d82aa84-9785-4d05-8b15-9b0f299ca08d/
1 parent cb731cf commit b80bef8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Scrabble/scrabble.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def compute_score(word):
3838
ValueError: If the word is invalid or contains non-alphabetic characters.
3939
"""
4040
score_list = {
41-
'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2,
41+
'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2,
4242
'h': 4, 'i': 1, 'j': 8, 'k': 5, 'l': 1, 'm': 3, 'n': 1,
4343
'o': 1, 'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1, 'u': 1,
4444
'v': 4, 'w': 4, 'x': 8, 'y': 4, 'z': 10}
@@ -105,10 +105,12 @@ def winner(score_board):
105105
Raises:
106106
IndexError: If there are no players in the score board.
107107
"""
108-
sorted_scores = sorted(score_board.items(), key=lambda x: x[1], reverse=True)
108+
sorted_scores = sorted(score_board.items(),
109+
key=lambda x: x[1], reverse=True)
109110
if len(sorted_scores) > 0:
110111
max_score = sorted_scores[0][1]
111-
winners = [player for player, score in sorted_scores if score == max_score]
112+
winners = [player for player,
113+
score in sorted_scores if score == max_score]
112114
if len(winners) > 1:
113115
return f"It's a tie. The winners are {', '.join(winners)}!!"
114116
return f"The winner is {winners[0]}!"

0 commit comments

Comments
 (0)