Skip to content

Latest commit

 

History

History
50 lines (48 loc) · 1.34 KB

File metadata and controls

50 lines (48 loc) · 1.34 KB

example.org

This function computes whether number is even or odd.

def evenorodd():

for loop iterates number from 1 to 20

for i in range(1,20):

Here if condition checks whether number is divisible by 2 or not

if((i%2)==0):

If the number is divisible by 2 it prints as even numbers

print i, "is a even number"

if condition fails then else condition will execute

else:

If number not divisible it will prints as odd numbers

print i, "is a odd number"

This is function call which calls evenorodd function

evenorodd()