Skip to content

Commit

Permalink
Update solution.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ikostan committed Dec 30, 2024
1 parent 9a9d23d commit 04bd440
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kyu_7/pointless_farmer/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ def buy_or_sell(pairs: list, harvested_fruit: str) -> list[Any] | str:
if pair[0] == currently_holding == pair[-1] or pair[-1] == currently_holding:

Check notice on line 24 in kyu_7/pointless_farmer/solution.py

View check run for this annotation

codefactor.io / CodeFactor

kyu_7/pointless_farmer/solution.py#L24

Unnecessary "elif" after "continue", remove the leading "el" from "elif" (no-else-continue)

Check notice on line 24 in kyu_7/pointless_farmer/solution.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

kyu_7/pointless_farmer/solution.py#L24

Unnecessary "elif" after "continue", remove the leading "el" from "elif"
results.append('sell')
currently_holding = pair[0]
continue
elif pair[0] == currently_holding:
results.append('buy')
currently_holding = pair[-1]
else:
return "ERROR"
continue

return "ERROR"

return results if currently_holding == harvested_fruit else "ERROR"

0 comments on commit 04bd440

Please sign in to comment.