kiddo39 Junior Poster in Training 54 posts since Nov 2008 Reputation Points: 0 [?] Q&As Helped to Solve: 0 [?] Skill Endorsements: 0 [?] •Community Member 0 6 Years Ago I know python has math functions like 5+6 and 5*6 and 5/6 etc...but I have something like this: x=575124357 and need to add them all together: 5+7+5+1+2+4+3+5+8=40

vegaseat DaniWeb's Hypocrite 8,175 posts since Oct 2004 Reputation Points: 1,722 [?] Q&As Helped to Solve: 2,256 [?] Skill Endorsements: 91 [?] •Moderator 0 6 Years Ago We help those who show a little effort at first. Hint, convert x to a string and iterate the string summing up the int value of each character.

kiddo39 Junior Poster in Training 54 posts since Nov 2008 Reputation Points: 0 [?] Q&As Helped to Solve: 0 [?] Skill Endorsements: 0 [?] 0 6 Years Ago Something like this will work, I just have to get it to the point that it does it without the 'raw_input'...... >>>sum([int(i) for i in raw_input("Enter integer: ")]) Enter integer:1234567 28

kiddo39 Junior Poster in Training 54 posts since Nov 2008 Reputation Points: 0 [?] Q&As Helped to Solve: 0 [?] Skill Endorsements: 0 [?] 0 6 Years Ago Wait, I think I've got it: >>>x=1234567 >>>sum(int (i) for i in str(x)]) 28