From 30c09038ce6034669b471589bb9b2bea4e6d20c8 Mon Sep 17 00:00:00 2001 From: Hai Vu Date: Thu, 25 Jul 2019 06:53:08 -0700 Subject: [PATCH] Fix Merge two dicts The square brackets are wrong and will generates a `SyntaxError`, the correct way is to use curly brackets. I have tested this before making the update. --- sheets/_python/1line | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sheets/_python/1line b/sheets/_python/1line index 2517a1d..45f08a2 100644 --- a/sheets/_python/1line +++ b/sheets/_python/1line @@ -9,7 +9,7 @@ a, b = b, a print(list(itertools.chain(*my_list))) # Merge two dicts -[**d1, **d2] +{**d1, **d2} # Reverse key, value in a dict {v: k for k, v in d.items()} @@ -56,4 +56,4 @@ python -c "while 1:import random;print(random.choice('|| __'), end='')" python -c "import random;p=lambda:random.choice('7♪♫♣♠♦♥◄☼☽');[print('|'.join([p(),p(),p()]),end='\r') for i in range(8**5)]" # Guess number game -python -c "import random;n=random.randint(1,99);[(lambda a:print('Y' if a==n else 'H' if a>n else 'L'))(int(input())) for i in range(6)]" \ No newline at end of file +python -c "import random;n=random.randint(1,99);[(lambda a:print('Y' if a==n else 'H' if a>n else 'L'))(int(input())) for i in range(6)]"