From 8af6fe12d6e6a05bcd457e7ccc35ae04847426e3 Mon Sep 17 00:00:00 2001 From: WyreYote Date: Sat, 10 Mar 2018 16:35:05 -0700 Subject: [PATCH] Updated Code snippets (markdown) --- Code-snippets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code-snippets.md b/Code-snippets.md index 66a8ec0..ffb60fb 100644 --- a/Code-snippets.md +++ b/Code-snippets.md @@ -202,7 +202,7 @@ Where `photos` is a list of `PhotoSize` objects and `desired_size` is a tuple co >>> def get_closest(photos, desired_size): >>> def diff(p): return p.width - desired_size[0], p.height - desired_size[1] >>> def norm(t): return abs(t[0] + t[1] * 1j) ->>> return sorted(photos, key=lambda p: norm(diff(p)))[0] +>>> return min(photos, key=lambda p: norm(diff(p))) ``` #### Download a file