0

skip

how to skip even numbers in python

13th Dec 2020, 9:47 AM
Somasundaram Puspagaran
Somasundaram Puspagaran - avatar
3 Answers
+ 3
for i in range(n): if i % 2 == 0: continue else: #ur code goes here
13th Dec 2020, 9:49 AM
Š˜Š²Š°Š½ Š§ŠøŠŗyŠ½Š¾Š²
Š˜Š²Š°Š½ Š§ŠøŠŗyŠ½Š¾Š² - avatar
+ 2
def is_even(num): if num%2 == 0: return True else : return False print(is_even(4)) #True now do as Š˜Š²Š°Š½ Š§ŠøŠŗyŠ½Š¾Š² said and use this func in your program to check number is even or not.. Happy coding !!
13th Dec 2020, 9:54 AM
Ratnapal Shende
Ratnapal Shende - avatar
0
thanks
13th Dec 2020, 9:51 AM
Somasundaram Puspagaran
Somasundaram Puspagaran - avatar