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))
3 Réponses
+ 1
When you call function and print ,count value is printed ,or can you be more clear what you wanna know!
0
Abhay, the output is returning 2 instead of 3