Which data type matches the string literal "True"?

Study for the End of Year 8 Computer Science Test. Prepare with flashcards and multiple choice questions, each with hints and explanations. Get ready for your exam!

Multiple Choice

Which data type matches the string literal "True"?

Explanation:
Strings are sequences of characters. When you put something in quotation marks, it’s treated as a string literal, meaning the value is text. The string "True" is just the letters T, r, u, e inside quotes, so it’s a string, not the boolean true. If you wrote True without quotes, many languages would interpret that as a boolean value. The other types describe numbers or logical values without quotes—an integer is a whole number, and a float is a number with a decimal point. So the match for the quoted text "True" is a string.

Strings are sequences of characters. When you put something in quotation marks, it’s treated as a string literal, meaning the value is text. The string "True" is just the letters T, r, u, e inside quotes, so it’s a string, not the boolean true. If you wrote True without quotes, many languages would interpret that as a boolean value. The other types describe numbers or logical values without quotes—an integer is a whole number, and a float is a number with a decimal point. So the match for the quoted text "True" is a string.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy