Skip to content

Commit 3b1a4c5

Browse files
authored
program to print even numbers from 1-20
1 parent d4d1cae commit 3b1a4c5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

PrintEven.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def main():
2+
print("\nBy Using While Loop\n")
3+
no=1
4+
while no<21:
5+
if no%2==0:
6+
print(no,end=" ")
7+
no=no+1
8+
9+
print("\n\n\nBy Using For Loop\n")
10+
for no in range(2,21,2):
11+
print(no,end=" ")
12+
print("\n")
13+
14+
15+
16+
if __name__=="__main__":
17+
main()
18+

0 commit comments

Comments
 (0)