Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

digit sum codechef

#Solution provided by Sloth Coders 
n = int(input())
for _ in range(n):
    num = input()
    sum = 0
    for i in num:
        sum += int(i)
    print(sum)
Comment

PREVIOUS NEXT
Code Example
Python :: make button bigger tkinter with grid 
Python :: argparse cli 
Python :: create an empty numpy array and append 
Python :: python os get path 
Python :: Matplotlib rotated x tick labels 
Python :: seed python 
Python :: get query params flask 
Python :: heroku django procfile 
Python :: if number is divisible by 3 python 
Python :: python delete element from list 
Python :: python datetime get weekday name 
Python :: python Modulo 10^9+7 (1000000007) 
Python :: input in one line python 
Python :: get request body flask 
Python :: decimal to octal in python 
Python :: pandas excel sheet name 
Python :: python replace null in list 
Python :: python append csv to dataframe 
Python :: model evaluate function 
Python :: socketserver python 
Python :: python array slice 
Python :: .describe() python 
Python :: in dataframe particular column to string 
Python :: pandas drop duplicate keep last 
Python :: Sum items in a list with ints and strings in python 
Python :: Python Tkinter Button Widget Syntax 
Python :: load pt file 
Python :: can only concatenate str (not "int") to str 
Python :: python example 
Python :: convert pandas dataframe to dict with a column as key 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =