+10 XP
Variables: Storing Information
A variable is like a labeled box. You put something inside it and give it a name so you can use it later.
python
membrane_voltage = -70 # millivolts (resting potential!)
spike_threshold = -55
neuron_name = 'Pyramidal Cell'
is_firing = FalseVariables store numbers, text, or true/false values.
Notice how variable names describe what they store. membrane_voltage = -70 means 'the membrane voltage is -70 millivolts.' This is exactly how NMA code is written.
In Python, you don't need to declare a type β just write name = value.