Ask coding questions

← Back to all posts
What is a variable?
h
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
GavinBryant
AldenGamble
Highwayman
DeaconBurgess
Roar123
SixBeeps
Comments
hotnewtop
MrEconomical

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

SixBeeps

@MrEconomical Sounds pretty sus ngl

SixBeeps

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

Highwayman

amountChickens

Roar123

variable = variable

DynamicSquid

Ah, you actually got me there...

I thought you were going crazy for a second

SixBeeps

@DynamicSquid lmao gotem

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..."

[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

DynamicSquid

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

[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

DynamicSquid
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 <<<<<<<<<<<<<------------!!!!!!!!!!!!!!!!!!!!!!!!!

[deleted]

@DeaconBurgess this was april fools joke

DeaconBurgess

@Thecrowbar1234 4th time in a row :(

SixBeeps

@Thecrowbar1234 r/woooosh

dillonjoshua68

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

SixBeeps

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

dillonjoshua68

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

SixBeeps

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

dillonjoshua68

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

SixBeeps

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

dillonjoshua68
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!

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

SixBeeps

@MesyetiIsTaken This is very information

MesyetiIsTaken

@SixBeeps what?

SixBeeps

@MesyetiIsTaken
Look at when my original post was created

FlaminHotValdez

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

[deleted]

I'm assuming it's python.

A variable is to store data like:

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

SixBeeps

@GaneshaSharma Look at the date/time this was posted

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

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.

SixBeeps

@Baconman321 Look at when this was posted

Baconman321

@SixBeeps I know

SixBeeps

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

Baconman321

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

Highwayman

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

Baconman321

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

Highwayman

@Baconman321 🤷‍♂️ Thanks anyways :P

JannaYoussef

A variable is a name that stores a specific value.

SixBeeps

@JannaYoussef Look at when this was posted

[deleted]

ha you tryed

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.

3465728974563

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