Python Program to Find Sum of Even & Product of Odd Digits of a Number - In Hindi

preview_player
Показать описание
Python Program to Find Sum of Even & Product of Odd Digits of a Number - In Hindi

In this video, I have explained a program to find sum of Even & Product of Odd Digits of a given number. For Example if the given number is 15324 then we have to find sum of even numbers i.e. 2+4=6 and product of odd digits i.e. 1*5*3=15.

We will do Sum of Even & Product of Odd Digits of a Number program using While statement. While statement is used to execute a single statement or a block of statement n times till the condition is true. Every loop must contain three parts:

1. Initialization of counter variable.
2. Condition
3. Increment/Decrement of counter variable

While loop or any loop will work fine if all the three parts are there in the programs. If any one is missing the loop will not run properly.

#codeitup
#whileloop
#python
Рекомендации по теме
Комментарии
Автор

Sir aapke program dekhne sae phle
Bahoot video dekhi other youtuber ki per aap jase program clear or kisi video mae nhi hua💯💯💯💯

Poonampahal
Автор

awesome sir, because of your explanation method i started applying logic and from 0 came to almost 90% for solving problem while applying logic. tx to u sir.

sidj
Автор

This Video helped me a lot, Thanx Sir ..

Now I feel confident about my Exams

PeakMasterOfficial
Автор

sir kasam se keh raha hun sir ur work is lit, .,.,.,.,.,.mera ek dialogue hai ....
print("graphic work for sir ") ... and it just for u
....i choosed this because ghraphic card adds beautiness in system similarly its work is graphic for us like NVIDIA 2060

ommprakashdas
Автор

very nice video please give answer the product of first 10 natural number using while.

anushkasharma
Автор

i=int(input ("Enter the number"))
Sum=0
Prod=1
While(i >0):
If i%2==0
Sum=sum+(i %10)
i =i //10
else:
Prod=(i%10)*prod
i=i//10
Print("sum of even digit=", sum)
Print("product of odd digit=", prod)


Sir ye Q sahi he kya ....plz ans 🙏

atharvawadalkar
Автор

Please explain prime number program sir

punamkumari
Автор

Sir please do my question " write a python program to get the sum of all odd numbered placed number. Input : 19476
Output : 11

neelamtiwari
Автор

Sir, what to do if we have all the digits same. Say 2222
In this case the product is coming out as 1 but it should be 0 since there are no odd digits

shariqzahid
Автор

Hi! How to write this program using a "function"?? Kindly reply.

shubhamagarwal