Advertisement
JoelSjogren

Untitled

May 20th, 2023
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. box% python
  2. Python 3.11.3 (main, Apr 5 2023, 15:52:25) [GCC 12.2.1 20230201] on linux
  3. Type "help", "copyright", "credits" or "license" for more information.
  4. >>> def Q(x):
  5. ... u, v, w = x
  6. ... return 0, v, w
  7. ...
  8. >>> def P(x):
  9. ... u, v, w = x
  10. ... return u, 0, w
  11. ...
  12. >>> def F(x):
  13. ... u, v, w = x
  14. ... return 2*u, 3*v, 5*w
  15. ...
  16. >>> B = lambda f: lambda x: Q(f(P(x)))
  17. >>> F([1.4, 6.34, 3.14])
  18. (2.8, 19.02, 15.700000000000001)
  19. >>> B(F)([1.4, 6.34, 3.14])
  20. (0, 0, 15.700000000000001)
  21. >>> B(B(F))([1.4, 6.34, 3.14])
  22. (0, 0, 15.700000000000001)
  23. >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement