+ 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)

18th Apr 2020, 2:27 PM
Uzochukwu Emmanuel
Uzochukwu Emmanuel - avatar
2 Réponses
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?
19th Apr 2020, 6:25 PM
MyNameIsMutable
MyNameIsMutable - avatar
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
19th Apr 2020, 6:54 PM
MyNameIsMutable
MyNameIsMutable - avatar