From 33d991538577e0e60e818e973b7bf201cc81d619 Mon Sep 17 00:00:00 2001 From: Geoffrey Sametz Date: Tue, 7 Mar 2023 13:55:10 -0500 Subject: [PATCH] `inp` will evaluate truthy or falsey without the need for `bool()`, although `bool(inp)` makes the intent more clear. --- 2023/three-problems.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2023/three-problems.md b/2023/three-problems.md index 7a98502..ebe0799 100644 --- a/2023/three-problems.md +++ b/2023/three-problems.md @@ -25,7 +25,7 @@ function to do that: ```python def shift(inp): - return bool(inp) and (inp[0], inp[1:]) + return inp and (inp[0], inp[1:]) ``` Given an input sequence `inp`, this returns the first item `inp[0]` and all of