Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
python Sum of digits eg #4
SUBMITTED BY:
Guest
DATE:
Dec. 16, 2013, 8:44 a.m.
FORMAT:
Python
SIZE:
166 Bytes
Raw
Download
Tweet
HITS:
855
Go to comments
Report
# find sum of digits
n
=
input
(
"enter an integer : "
)
print
(
str
.
join
(
" l"
,
n
))
print
(
eval
(
str
.
join
(
" + "
,
n
)))
print
(
eval
(
'+'
.
join
(
list
(
n
))))
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus