Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!feeds.phibee-telecom.net!news.panservice.it!feed.xsnews.nl!border02.ams.xsnews.nl!feeder04.ams.xsnews.nl!feeder02.ams.xsnews.nl!abp002.ams.xsnews.nl!frontend-F09-04.ams.news.kpn.nl From: Cecil Westerhof Newsgroups: comp.lang.python Subject: Re: Is my implementation of happy number OK Organization: Decebal Computing References: <87oam5vc8k.fsf@Equus.decebal.nl> X-Face: "(y8cC@tg_12{">GF'UXTW]FHI2wMiZNrnf'1EFQ&O#$m:f#O7+7}kR,v+Pti8=Vi/Z"g^?b"E X-Homepage: http://www.decebal.nl/ Date: Thu, 30 Apr 2015 21:05:59 +0200 Message-ID: <87bni5tp0o.fsf@Equus.decebal.nl> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:nXXBIhatWf9TiH/eWppZnSeOII0= MIME-Version: 1.0 Content-Type: text/plain Lines: 22 NNTP-Posting-Host: 81.207.62.244 X-Trace: 1430422131 news.kpn.nl 19259 81.207.62.244@kpn/81.207.62.244:40469 Xref: csiph.com comp.lang.python:89663 Op Thursday 30 Apr 2015 19:37 CEST schreef Ian Kelly: Most I still have to digest. ;-) > On Thu, Apr 30, 2015 at 9:59 AM, Cecil Westerhof wrote: >> return (current_array, ''.join(current_array)) > > You don't seem to be actually using current_array for anything, so > why not just return the string? My implementation was not finished. I had intended to make it: current_array, \ current_string = create_current(sum([value ** 2 for value in current_array])) But it does not make it significantly faster, so yes, I am going to return only the string. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof