SHARE
TWEET

Untitled

a guest Nov 11th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def teil_b(res1):
  2.     global result
  3.     result = 0
  4.     return res1
  5. result = 0
  6. def rec(integer):
  7.     global result
  8.     if integer == 0:
  9.         integer = 0
  10.         return teil_b(result)
  11.     else:
  12.         print("vorher:", result)
  13.         result = result + integer * integer
  14.         print("nachher:", result)
  15.         return rec(integer-1)
  16.  
  17. assert itr(2) == rec(2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top