Quick actions

cmd+k|ctrl+k

Navigation

Languages

Toy 1

Snippet info

Language

Python

Visibility

public

Author

chausage

Created

2024-12-05T08:08:35.597848Z

Updated

2024-12-05T09:14:16.67698Z

class toy: #create a scenario
    head='blue'
    body='blue'
    def a(self): #a, you can be any word. 'you' becomes toy1 / 2 
        print('toy is running', self.head, self.body)
toy1=toy() #create toy1 relating toy()
print(toy1.head)
toy1.head='yellow' #change toy1.head color to yellow
print(toy1.head)
toy2=toy()
toy2.head='red'
toy.head='lime'
print(toy2.head)
print(toy.head)
INFO