Class (6-12-2024)

Run Settings
LanguagePython
Language Version
Run Command
class Toy: '''This is a toy class''' #add a docstring head='blue' body='blue' def a(self): print('class internal function') return 123 toy1=Toy() print(dir(toy1)) #print the hidden functions in toy1 print(Toy.__dict__)#print the hidden functions in Toy's Dict print(toy1.__dict__) #print the hidden functions in toy1's Dict, nothing inside yet print(toy1.a) #print address of Toy1.a function toy1.a() #run Toy.a(toy1) print(toy1.a()) #run Toy.a(toy1) and return toy1.x=1# assign value to toy1.x print(toy1)#address of toy1 print(toy1.x)#value of toy1.x print(toy1.__dict__) print(toy1.head) #print Toy.head Toy.a(Toy) print(Toy.head)
Editor Settings
Theme
Key bindings
Full width
Lines