What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-30 00:51:51
local vs global variables
# in functions we use Global vs Local variables # Global means as the name suggests it's Global (accessed anywhere in file) def player_health(): # Local variable # Local variables can't be accessed outside of a function player_health = 78 # err... Add solution -
C++ 2022-01-27 23:35:53
extern c++
// extern basically defines a global variable. //fileA.cpp int i = 42; // declaration and definition //fileB.cpp extern int i; // declaration only. same as i in FileA //fileC.cpp extern int i; // declaration only. same as i in FileA //fileD.cpp int ... Add solution -
Python 2022-01-24 17:40:25
metaclass python
A metaclass is the class of a class. A class defines how an instance of the class (i.e. an object) behaves while a metaclass defines how a class behaves. A class is an instance of a metaclass. While in Python you can use arbitrary callables for metaclass... Add solution -
Python 2022-01-23 14:40:48
discord.py cog classes
from discord.ext import commands class Test_Cog(commands.Cog): def __init__(self, bot): self.bot = bot # defining bot as global var in class @commands.Cog.listener() # this is a decorator for events/listeners async def on_ready(self): ... Add solution -