Adding source code files for Chapter 6

This commit is contained in:
muassif
2021-03-13 19:25:45 +04:00
committed by GitHub
parent e662762d09
commit 9589675a50
45 changed files with 625 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
#setcomp1.py
list1 = [1, 2, 6, 4, 5, 6, 7, 8, 9, 10, 8]
set1 = {x for x in list1 if x % 2 ==0}
print(set1)
set2 = set()
for x in list1:
if x % 2 == 0:
set2.add(x)
print(set2)