Which of the following words can be used as a variable name? (Choose two valid names)
Suggested Answer: D, C
Get Premium PCAP-31-03 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
26 comments · newest first
FL
Fletcher
4 months ago
No, that one's invalid. Can't start with a number.
MO
Mollie
5 months ago
What about "1stVariable"?
LE
Leanna
5 months ago
Agreed! "user_name" works.
KA
Karrie
5 months ago
I think "user_name" is valid.
FR
Francis
7 months ago
Totally agree, "userName" is a classic choice!
KA
Kati
7 months ago
Wait, can special characters be used?
VA
Vanesa
7 months ago
I thought you couldn't start with a number?
LA
Lavonne
7 months ago
Definitely "userName" and "age" are valid!
JA
Jacquline
7 months ago
You can use letters and numbers in variable names.
FA
Fallon
7 months ago
Haha, I tried to use "Fluffy the Cat" as a variable name. Didn't end well.
JI
Jina
8 months ago
I tried to use "my variable" but it didn't work. Guess spaces aren't allowed.
TA
Tamala
8 months ago
123_variable is not a valid variable name.
VI
Vince
8 months ago
myVariable is a good choice.
TR
Tresa
8 months ago
x_123 is a valid variable name.
DA
Dannette
8 months ago
I think we had a similar question in our last quiz, and I remember something about reserved keywords. We should avoid those!
AL
Alyssa
8 months ago
I’m not entirely sure, but I feel like "myVariable" is a valid name. I hope I’m remembering that correctly!
LI
Ligia
9 months ago
I remember we practiced a question about valid variable names, and I think they can include letters and underscores.
JU
Julieta
9 months ago
I think variable names can’t start with a number, right? So maybe something like "var1" wouldn’t work.
BE
Beckie
10 months ago
I feel pretty confident about this one. The valid variable names are probably "myVariable" and "x123". Anything with spaces or special characters wouldn't work.
TU
Tula
10 months ago
Okay, let me think this through. Variable names need to start with a letter or underscore, and can only contain letters, digits, and underscores. So I'd say "myVar" and "var_123" are probably the valid options here.
VI
Viola
10 months ago
Ugh, I hate these syntax questions. I always get tripped up on the specific rules for variable naming. I'll just have to guess and hope for the best.
MA
Madelyn
10 months ago
Hmm, I'm not totally sure about this. I know variable names can't have spaces, but I'm not sure about other rules. Maybe "my_variable" and "variable123" could work?
MI
Millie
10 months ago
I think I know the answer to this one. Variable names can't have spaces or special characters, so I'd say the valid options are "myVariable" and "x123".
HO
Hobert
4 months ago
Definitely! Spaces are a problem too.
LA
Lashandra
4 months ago
Yeah, special characters are a no-go.
EM
Emerson
4 months ago
I agree, "myVariable" and "x123" are good choices.