Class 1 (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,c): # create a function print('class internal function',c) #c is a word def __init__(self, leg): # sub-program's function self.leg=leg toy1=Toy(2) print(Toy.__dict__)#print Toy's Dict print(toy1.__dict__) #print toy1's Dict print(toy1.a) #print address of Toy1.a function print(toy1.a('abc')) #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__) toy2=Toy(4) print(toy1.head) #print Toy.head
Editor Settings
Theme
Key bindings
Full width
Lines