Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 314d3ca commit d5758bbCopy full SHA for d5758bb
gen.py
@@ -0,0 +1,6 @@
1
+#3. Write a generator to get even numbers from 1 to infinity.
2
+
3
+n=int(input("Enter the limit:"))
4
+Gen_val=(i for i in range(0,n+1) if(i%2==0))
5
+for val in Gen_val:
6
+ print(val)
0 commit comments