how to get powers 1

how to get powers

how to get powers

Here is what the above code is Doing:
1. We’re creating a class called “Superhero”
2. We’re creating a function called “__init__” that will run every time we create a new instance of the class.
3. We’re creating a variable called “name” that will be equal to whatever we pass in when we create a new instance of the class.
4. We’re creating a variable called “powers” that will be equal to an empty list.
5. We’re creating a function called “add_power” that will add a new power to the “powers” list.
6. We’re creating a function called “use_power” that will remove a power from the “powers” list.

Similar Posts