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) 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.') + +