This sheet covers common types in code
A String is like a sentence, a bunch of words, or a paragraph. Anything that has text in it. That text is made up of Char
acters, things like letters, numbers, and punctuation. Most languages like strings enclosed in ""
or ''
.
Any integer value (A number).
Like a list of objects, a lot of languages have syntax similar to myArray[0]
to access items in an array. In this example we are retrieving the value in myArray
‘s slot number [0
].
A bool
is a true
or false
value. It can be on or off, one or zero. These are very good for basic logic. Check your language’s documentation for how to make one of these; I have ran into countless situations where true
is not True
or TRUE
. Yay for case-sensitivity.
A dictionary usually refers to a list of values with corresponding keys. Basically, you can store data and set it to be found from a specific unique text. an example could be:
myDictionary = {
message: "Hello World!",
count: 3,
isUseful: true
}
Hope you found this cheat sheet useful! This covered some of the most basic datatypes, but there are likely many others depending on your language (don’t get me started on classes). If you are still confused consider checking out https://www.w3schools.com/ . Or consider reading another one of my articles: