From 34a9b64217cf69cb0fad2ba34e5cbe5393775cec Mon Sep 17 00:00:00 2001 From: Rahul Kumar Tiwari <31995292+Rahul-Kumar-Tiwari@users.noreply.github.com> Date: Wed, 24 Oct 2018 14:18:09 +0530 Subject: [PATCH] Update 7_count_even_and_odd_number.py comments are added --- class3/7_count_even_and_odd_number.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/class3/7_count_even_and_odd_number.py b/class3/7_count_even_and_odd_number.py index 4d4ba65..4756463 100644 --- a/class3/7_count_even_and_odd_number.py +++ b/class3/7_count_even_and_odd_number.py @@ -1,11 +1,11 @@ #counting odd and even number in list -l=[1,2,3,4,5,6,7,8,9] +l=[1,2,3,4,5,6,7,8,9] #list of even and odd numbers odd=0 even=0 for x in l: if x%2==0: - even+=1 + even+=1 #count the even no else: - odd=odd+1 -print("number of odd numbers in the list is :"+str(odd)) -print("number of even numbers in the list is :"+str(even)) \ No newline at end of file + odd=odd+1 #count the odd no +print("number of odd numbers in the list is :"+str(odd)) +print("number of even numbers in the list is :"+str(even))