SHARE
TWEET

Untitled

a guest Jul 17th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def calc7(s):
  2. #    for i in s:
  3. #        if s[i] == 7:
  4. #         ret = s.sub(s[i+1],s[i+1]*2)
  5. #         i += 1
  6. #         return ret
  7. #        ret = sum(s)
  8. #    else:
  9. #        ret = sum(s)
  10.     if len(s) == 0:
  11.         ret = -1
  12.     else:
  13.         ret = sum(s)
  14.     return ret
  15.  
  16. print(calc7([1, 2]))
  17. print(calc7([3, 7]))
  18. print(calc7([7, 5, 6]))
  19. print(calc7([7, 9, 7, 9, 7, 9]))
  20. print(calc7([]))
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
 
Top