0

Please guys, I've been working on a question and I'm not getting it. How do I get my count for questions involving recursion in

def single2stupor(num): a = str(num) count = 0 for i in range(0,len(a)-1): b = int(a[i])*int(a[i+1]) if len(str(b)) == 1: count += 1 elif len(str(b)) > 1: count = 1 a = str(b) b = single2stupor (a) count+= 1 return count print(single2stupor (87))

16th May 2020, 9:50 PM
Eke John Igwe
Eke John Igwe - avatar
3 Answers
+ 1
When you call function and print ,count value is printed ,or can you be more clear what you wanna know!
16th May 2020, 9:53 PM
Abhay
Abhay - avatar
0
Abhay, the output is returning 2 instead of 3
16th May 2020, 9:55 PM
Eke John Igwe
Eke John Igwe - avatar