convertor generator to a list for print function

This commit is contained in:
muassif
2021-08-12 17:31:10 +04:00
committed by GitHub
parent 7416895085
commit d9f3f5b159
+1 -1
View File
@@ -2,4 +2,4 @@
list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
gen1 = (x for x in list1 if x % 2 ==0)
print(gen1)
print(list(gen1))