Skip to content
← Back to Community
What is a variable?
Profile icon
SixBeeps

Hello,
I am working on some of my Computer Science homework, and we're on the Variables unit. But, I am having a hard time understanding what a "variable" actually is. Can someone help me with this?

Answered by MrEconomical [earned 5 cycles]
View Answer
Voters
Profile icon
JonathanJuares
Profile icon
GavinBryant
Profile icon
AldenGamble
Profile icon
Highwayman
Profile icon
DeaconBurgess
Profile icon
Roar123
Profile icon
SixBeeps
Comments
hotnewtop
Profile icon
MrEconomical

if you mark this comment as the answer, you shall be forever blessed.

Profile icon
SixBeeps

@MrEconomical Sounds pretty sus ngl

Profile icon
SixBeeps

@MrEconomical It has been exactly 11 months, so here ya go.

Profile icon
Highwayman

amountChickens

Profile icon
Roar123

variable = variable

Profile icon
DynamicSquid

Ah, you actually got me there...

I thought you were going crazy for a second

Profile icon
SixBeeps

@DynamicSquid lmao gotem

Profile icon
DynamicSquid

@SixBeeps At first I looked at your question and was like "come on, what kinda question is this?", then I looked at your username and was like "hold up..."

Profile icon
[deleted]

He’s not crazy. Sometimes people know what it is, but can’t explain. For instance, take the definition of “know”. You would say, “I know what it means, but I can’t say it in words.” It’s kind of like that. @DynamicSquid

Profile icon
DynamicSquid

@CodeABC123 True, but I was referring more to the person asking the question. Like @SixBeeps asking this question?

Profile icon
[deleted]

I know, I also thought he was going crazy for a second too, but I thought carefully. And some of the best coders are not the best explainers, like me. I’m good at coding, but I have a hard time explaining why I didn’t do my homework. @DynamicSquid

Profile icon
DynamicSquid
Profile icon
[deleted]
Profile icon
DeaconBurgess

A variable can be a lot of thing like a bool describes true or false variables are data values that can changes when the user is asked a queston - GOOGLE DEFINITION <<<<<<<<<<<<<------------!!!!!!!!!!!!!!!!!!!!!!!!!

Profile icon
[deleted]

@DeaconBurgess this was april fools joke

Profile icon
DeaconBurgess

@Thecrowbar1234 4th time in a row :(

Profile icon
SixBeeps

@Thecrowbar1234 r/woooosh

Profile icon
dillonjoshua68

What grade u in....
I’m currently going to year 11 (Gonna have IGCSE ‘s at the end of the year)

Profile icon
SixBeeps

@dillonjoshua68 I'm going to be a freshman in college

Profile icon
dillonjoshua68

Ohhh ok, so u must’ve finished ur A-levels recently? @SixBeeps

Profile icon
SixBeeps

@dillonjoshua68 I'm in the US, so we don't have them :)

Profile icon
dillonjoshua68

Oh ok :) .. I’m in UAE, in a British curriculum school... so yah... I will be having them in the future @SixBeeps

Profile icon
SixBeeps

@dillonjoshua68 Ah I see. Good luck with them ^^

Profile icon
dillonjoshua68
Profile icon
Coder100

A variable can be thought of as a "storage container". For some languages, this storage container has a specific to what is allowed and what isn't, such as C#. To other languages, this is undetermined, such as JavaScript.

Also, nice joke!

Profile icon
MesyetiIsTaken

It's like a file containing information, but very small and 8nky on 1 line, for more than 1 line it's a list

Profile icon
SixBeeps

@MesyetiIsTaken This is very information

Profile icon
MesyetiIsTaken

@SixBeeps what?

Profile icon
SixBeeps

@MesyetiIsTaken
Look at when my original post was created

Profile icon
FlaminHotValdez

@SixBeeps Good April Fools joke. Not falling for it.

Profile icon
[deleted]

I'm assuming it's python.

A variable is to store data like:

hi = "Hi," name = input("What is your name?\n") print(hi, name + "!")

You can use it for input, numbers, strings (text), and all sorts of things!

Profile icon
SixBeeps

@GaneshaSharma Look at the date/time this was posted

Profile icon
CodeLongAndPros

A variable is a location in memory where your data is stored. The variable is a pointer to the address where the var is stored. Ex: 0x7c00, 0xFFFFF

Profile icon
Baconman321

Think of a variable as a container, and the computer labels it. When you are ready to retrieve or modify it, the computer finds the "container" and does whatever you tell it to do.

Profile icon
SixBeeps

@Baconman321 Look at when this was posted

Profile icon
Baconman321

@SixBeeps I know

Profile icon
SixBeeps

@Baconman321 Then why did you respond with a legitimate answer?

Profile icon
Baconman321

@SixBeeps Because yes (also for anyone viewing this question that doesn't know what a variable is).

Profile icon
Highwayman

@Baconman321 can I use your answer for a tutorial I’m making that will never come to fruition?

Profile icon
Baconman321

@Highwayman sure, it's taken from alot of other tutorials though.

Profile icon
Highwayman

@Baconman321 🤷‍♂️ Thanks anyways :P

Profile icon
JannaYoussef

A variable is a name that stores a specific value.

Profile icon
SixBeeps

@JannaYoussef Look at when this was posted

Profile icon
[deleted]

ha you tryed

Profile icon
staticvoidliam7

In programming, a variable is a value that can change, depending on conditions or on information passed to the program. Typically, a program consists of instruction s that tell the computer what to do and data that the program uses when it is running.

Profile icon
3465728974563

Look at when this was posted and who it was posted by. @LiamDonohue