Here is an example which creates a point as p=Point(x, y). Assume that I have some array ppp=(x, y) where x and y are numbers and I want to make it of class Point but in the way: p=Point(ppp). I can do either one or another way but not both simultaneously. Is it possible to have both ways?
Here is an example which creates a point as p=Point(x, y) . Assume that
Share
If you know that you have a tuple/list while creating the instance, you can do:
p = Point(*ppp), wherepppis the tuple.