Python Online Compiler & Playground
HTML/CSS/JavaScript
HTML
CSS
Javascript
C++
C
PHP
Java
Python
Swift
C#
Ruby
Node.JS
Kotlin
jQuery
Go
R
TypeScript
Start Python Course
Register
UserDefinedObject
+2
Author: Sousou
Dark
Public
Save
PY
py
1
2
3
4
5
6
7
8
9
class
Collection
:
def
__init__
(
self
,
*args
):
self
.args = args
def
__str__
(
self
):
return
f
'Collection{self.args}'
x = Collection
(
10
,
30
,
40
)
print
(
x
)
Enter to Rename, Shift+Enter to Preview
OUTPUT