Skip to content

Commit b64700a

Browse files
Merge pull request #3 from geekcomputers/master
merge from main.
2 parents cf8a21b + c995fc0 commit b64700a

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

Print_List_of_Even_Numbers.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
#user can give in put now
2-
#pyhton3
1+
#user can give input now
2+
#python3
3+
4+
import sys
5+
6+
if sys.version_info[0]==2:
7+
version=2
8+
else:
9+
version=3
10+
11+
if version==2:
12+
n=input('Enter number of even numbers to print: ')
13+
printed=0
14+
numbers=0
15+
while printed!=n:
16+
if numbers%2==0:
17+
print numbers,
18+
printed+=1
19+
numbers+=1
20+
21+
if version==3:
22+
print ([x for x in range(int(input()),int(input())) if not x%2])
23+
24+
325

4-
print ([x for x in range(int(input()),int(input())) if not x%2])

chaos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ def main():
77
x = 3.9 * x * (1-x)
88
print (x)
99

10-
main()
11-
10+
if __name__ == '__main__':
11+
main()

0 commit comments

Comments
 (0)