+ 2
#can the two argument be called without typing code.x, code.y help
#can the two argument be called with typing code.x, code.y help class Point(): def __init__(self,x,y): self.x = x self.y =y code = Point(10,20,) print (code.x)
2 odpowiedzi
0
#can the two argument be called without typing code.x, code.y help
#can the two argument be called with typing code.x, code.y help
class Point():
def __init__(self,x,y):
self.x = x
self.y =y
#had uneeded comma
code = Point(10,20)
concat = str(code.x) + ", " + str(code.y)
# use bottom code if you want to split x and y into a list
#spl = concat.split(", ")
print (spl)
Does this help?
0
I thought about it and I think this is what you meant.
You can change x and y to what ever you want.
https://code.sololearn.com/cgw7sbKlj54n/?ref=app