Skip to content

33 Valid parentheses#55

Merged
ZelenyMartin merged 1 commit intoPyLadiesCZ-Brno:mainfrom
JanaDrazkova:jd-33-valid-parentheses
Apr 6, 2025
Merged

33 Valid parentheses#55
ZelenyMartin merged 1 commit intoPyLadiesCZ-Brno:mainfrom
JanaDrazkova:jd-33-valid-parentheses

Conversation

@JanaDrazkova
Copy link
Contributor

No description provided.

Comment on lines +20 to +23
if s == '':
return True
else:
return False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je tam opakující se kód. Ta úloha redukování závorek by se dala řešit funkcí.

Dále se nabízí zkrácení:

Suggested change
if s == '':
return True
else:
return False
return s == ''

popř. return not s, ale to možná není tak čitelné.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ad opakující se kód - původně jsem tam funkci měla, ale to bych si pak musela přepsat test file, aby načítal i tu mou další funkci, ne?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ne, test testuje funkci valid_parentheses. Pokud tato funkce volá jinou svou pomocnou funkci, tak to už je testu jedno.

@JanaDrazkova JanaDrazkova force-pushed the jd-33-valid-parentheses branch from 90c17e1 to 4f3061a Compare April 6, 2025 18:32
Copy link
Contributor

@ZelenyMartin ZelenyMartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nějaká další možnost zkrácení.

@JanaDrazkova JanaDrazkova force-pushed the jd-33-valid-parentheses branch from 4f3061a to 79b9282 Compare April 6, 2025 20:24
@ZelenyMartin ZelenyMartin merged commit 8c8abc9 into PyLadiesCZ-Brno:main Apr 6, 2025
3 checks passed
@JanaDrazkova JanaDrazkova deleted the jd-33-valid-parentheses branch April 7, 2025 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants