0

skip

how to skip even numbers in python

13th Dec 2020, 9:47 AM
Somasundaram Puspagaran
Somasundaram Puspagaran - avatar
4 Respostas
+ 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