Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Code
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
class student: school = 'telusko' def __init__ (self, m1, m2, m3): self.m1 = m1 self.m2 = m2 self.m3 = m3 def avg(self): return (self.m1 + self.m2 + self.m3)/3 def get_m1(self): return self.m1 def set_m1(self,value): self.m1 = value @classmethod def info(cls): return cls.school s1 = student(5, 7, 8) s2 = student(7, 9, 6) print(s1.avg()) print(s2.avg()) print(student.info())
[
+
]
Show input
edit mode
|
history
|
discussion