Re: Python 3.7 Bug

2019-03-25 Thread CrazyVideoGamez
On Monday, March 25, 2019 at 2:07:11 PM UTC-4, Bassam Abdul-Baki wrote: > Greetings, > > In the following code, there's a bug on certain parameters. > > -- > > def per(n, steps = 0): > digits = [int(i) for i in str(n)] > result = 1 > for j in digits: > result *= j > steps += 1 > p

Re: Python 3.7 Bug

2019-03-25 Thread Terry Reedy
On 3/25/2019 8:14 AM, Bassam Abdul-Baki wrote: Greetings, In the following code, there's a bug on certain parameters. -- def per(n, steps = 0): digits = [int(i) for i in str(n)] result = 1 for j in digits: result *= j steps += 1 print(steps, result, sep=" - ") if result

Re: Python 3.7 Bug

2019-03-25 Thread DL Neil
Bassam, Greetings. On 26/03/19 1:14 AM, Bassam Abdul-Baki wrote: Greetings, In the following code, there's a bug on certain parameters. -- def per(n, steps = 0): digits = [int(i) for i in str(n)] result = 1 for j in digits: result *= j steps += 1 print(steps, result, sep

Re: Python 3.7 Bug

2019-03-25 Thread Peter Otten
Bassam Abdul-Baki wrote: > Greetings, > > In the following code, there's a bug on certain parameters. > > -- > > def per(n, steps = 0): > digits = [int(i) for i in str(n)] > result = 1 > for j in digits: > result *= j > steps += 1 > print(steps, result, sep=" - ") > if result ==

Re: Python 3.7 Bug

2019-03-25 Thread Chris Angelico
On Tue, Mar 26, 2019 at 5:08 AM Bassam Abdul-Baki wrote: > > def per(n, steps = 0): > if len(str(result)) == 1: > print(" --- DONE ---") > return "DONE" > else: > per(result, steps) > > -- > > What the program does: > If I run per(X) and X is a multiple of 10, I should end up with

Re: Python 3.7 Bug

2019-03-25 Thread Bassam Abdul-Baki
Greetings, In the following code, there's a bug on certain parameters. -- def per(n, steps = 0): digits = [int(i) for i in str(n)] result = 1 for j in digits: result *= j steps += 1 print(steps, result, sep=" - ") if result == 0: print(result, str(result), len(str(result)), sep