From 68805b2d4b9f5f5dbaaf3d720456452fc3c0d83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20G=C3=B6r?= Date: Mon, 12 Jun 2023 14:04:05 +0300 Subject: [PATCH] Dictionary Comprehensions --- python-temel/sozluk.iclemleri.2.py | 5 +++++ python-temel/sozluk.iclemleri.py | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 python-temel/sozluk.iclemleri.2.py create mode 100644 python-temel/sozluk.iclemleri.py diff --git a/python-temel/sozluk.iclemleri.2.py b/python-temel/sozluk.iclemleri.2.py new file mode 100644 index 0000000..2d95e23 --- /dev/null +++ b/python-temel/sozluk.iclemleri.2.py @@ -0,0 +1,5 @@ +d = {} +for i in [1, 2, 3, 4]: + d[i] = str(i) + +print(d) diff --git a/python-temel/sozluk.iclemleri.py b/python-temel/sozluk.iclemleri.py new file mode 100644 index 0000000..bb43f84 --- /dev/null +++ b/python-temel/sozluk.iclemleri.py @@ -0,0 +1,2 @@ +d = {i: str(i) for i in [1, 2, 3, 4, 5] } +print(d)