Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 65ad34c

Browse filesBrowse files
committed
ok
1 parent aeb2e79 commit 65ad34c
Copy full SHA for 65ad34c

File tree

1 file changed

+11
-0
lines changed
Filter options

1 file changed

+11
-0
lines changed

‎dictonary/Dict_Comprehensions2.py

Copy file name to clipboard
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
person={
2+
"name":"kuchbhi",
3+
"age":30,
4+
"city":"new yerk"
5+
}
6+
7+
squares = {x: x*x for x in range(6)}
8+
9+
# Dictionary comprehension with a condition
10+
even_squares = {x: x*x for x in range(10) if x % 2 == 0}
11+
print(even_squares) # Output: {0: 0, 2: 4, 4: 16, 6: 36, 8: 64}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.