From f6b2716c7d129c1c331a60c32714929016aed9e6 Mon Sep 17 00:00:00 2001 From: sparshg05 <55894372+sparshg05@users.noreply.github.com> Date: Fri, 4 Oct 2019 19:02:00 +0530 Subject: [PATCH 1/2] Update QUESTION.py --- QUESTION.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/QUESTION.py b/QUESTION.py index 2d388b7..0d2d927 100644 --- a/QUESTION.py +++ b/QUESTION.py @@ -1,4 +1,4 @@ -inp=0 +input=0 wish='B' product=1 sum=0 @@ -7,10 +7,10 @@ if wish=='q': break else: - inp=int(input("enter value")) - if inp%2==0: - sum=sum+inp + input=int(input("enter value")) + if input%2==0: + sum=sum+input else: - product=product*inp + product=product*input print("the sum of even numbers is >>", sum) print("the product of odd numbers is >>", product) From 91ad065a801ddc1393ae6ad6dc370c24bf08edea Mon Sep 17 00:00:00 2001 From: sparshg05 <55894372+sparshg05@users.noreply.github.com> Date: Fri, 4 Oct 2019 19:07:21 +0530 Subject: [PATCH 2/2] Add files via upload --- question2b.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 question2b.py diff --git a/question2b.py b/question2b.py new file mode 100644 index 0000000..5690d80 --- /dev/null +++ b/question2b.py @@ -0,0 +1,13 @@ +n=int(input('enter a number between 5-10: ')) +l=[] +for i in range(0,n): + l.append(input()) +#for k in range(0,n): + # print(l[k]) +count=0 +for j in range(0,n): + if (l[j] == 5): + count=count+1 +print('The number 5 is',count,'times in the above list.') + +