Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyClassInit
#Python 2.7.17 #PyClassInit: Class attribute, instance attribute and __init__() #this code is created by Rezaul Hoque on December 10,2021;contact: jewelmrh@yahoo.com #note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; class Book: price = 200 #Class attribute def __init__(self, title, author, genre): self.title = title #instance attribute self.author = author self.genre = genre book1 = Book("Sonar Kella", "Stayajit Ray", "Adventure") book2 = Book("Kim", " Rudyard Kipling", "Adventure") print(book1.title, book1.author, book1.genre,book1.price) book2.price= 260 print(book2.title, book2.author, book2.genre,book2.price)
run
|
edit
|
history
|
help
0
Crypto 123 - MD5
Gettinginput from users
L100
student grades
First programm
thnii957
tennis
Цідило
PyEnum
Problem: binary