Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

i=int(input("enter the number")); sum=0; pro=1; while(i>0): d=1%10; if (d%2==0): sum=sum+d; else: pro=pro*d; i=i//10; print("sum=",sum,"product=",pro);

i=int(input("enter the number"))
add=0
pro=1
while(i>0):
	d=1%10
	if (d%2==0):
		add=add+d
	else:
		pro=pro*d
i=i//10
print("sum=",add,"product=",pro)
Comment

PREVIOUS NEXT
Code Example
Python :: This line is compulsory to add anytime you want to use the Pygame library. It must be added before any other pygame function, else an initialization error may occur. 
Python :: how to subtract up everything in a list python 
Python :: générer des valeurs de 0 à n python liste 
Python :: loess dataframe 
Python :: backticks equivalent python template 
Python :: Drawing diff circles with random radius in diff positions . 
Python :: leer fichero linea por linea python 
Python :: what does features = data.drop(["Survived", "Sex", "Embarked"], axis=1) do in python 
Python :: select numbers from a list with a limit python 
Python :: Adam RMSprop Adagrad. 
Python :: split dataframe into multiple parts 
Python :: List Get Sublist 
Python :: pyton get minimum value of array 
Python :: create a django and react readonly web app 
Python :: PILImage.py", line 2975, in open fp = builtins.open(filename, "rb") PermissionError: [Errno 13] Permission denied: 
Python :: cors python functions framework local 
Python :: algorithme permettant de passer au negatif une image 
Python :: padnas get list of rows 
Python :: python does strftime work with date objects 
Python :: how to capture multiple screens with ImageGrab 
Python :: pandas apply return dataframe 
Python :: django how to delete a db field 
Python :: permcheck codility python 
Python :: asyncio RuntimeError: Event loop is closed 
Python :: kivy lang 
Python :: how to use google translate api in python 
Python :: function continuity python 
Python :: num = [7,8, 120, 25, 44, 20, 27] newnum = [] def remove_even(num): for i in num: if i%2 != 0: newnum.append(i) return newnum print("get_unevens") test(remove_even(num), [7,25,27]) 
Python :: combining list alternatively 
Python :: loops with variables that count 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =