Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy
- def main():
- xs0 = [1, 2, 3]
- xs1 = numpy.array([1, 2, 3, 4, 5])
- f = lambda x: x**2
- #print(f(xs0)) # invalid of course
- print(f(xs1)) # why does it work?
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement