From 1187842570aae61d22d19fa98f5c2823f06de8b1 Mon Sep 17 00:00:00 2001 From: Austin Bao <35129149+xy769@users.noreply.github.com> Date: Thu, 7 May 2026 21:01:19 +0800 Subject: [PATCH] Fix variable name: weapon -> fruit in list comprehension example (#105) The context is a fruit list ('fresh_fruit'), so using 'weapon' as the iteration variable is confusing. Changed to 'fruit' for clarity. --- src/data_types/test_lists.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data_types/test_lists.py b/src/data_types/test_lists.py index 33ffdbe9..227d7143 100644 --- a/src/data_types/test_lists.py +++ b/src/data_types/test_lists.py @@ -263,7 +263,7 @@ def test_list_comprehensions(): # Call a method on each element. fresh_fruit = [' banana', ' loganberry ', 'passion fruit '] - clean_fresh_fruit = [weapon.strip() for weapon in fresh_fruit] + clean_fresh_fruit = [fruit.strip() for fruit in fresh_fruit] assert clean_fresh_fruit == ['banana', 'loganberry', 'passion fruit'] # Create a list of 2-tuples like (number, square).