# Lee Her # CIS 122 # Ch.13 Program Ex 6: Ackermann's Function # Last modified on 05/30/2015 #Input value m=int(input('\nEnter a value for m: ')) print m n=int(input('\nEnter a value for n: ')) print n #Module def A(m,n): if(m==0): return n + 1 elif(n==0): return A(m - 1, 1) else: return A(m-1, A(m, n-1)) #Display results print('\nresult = {}'.format(A(m,n)))
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question