Welcome back everyone, to the second Chapter of the Journey of block code!
Lesson 1: comment time!
Today I will be teaching some important things to start off coding. First, I’d like to talk about comments! Comments are used to explain code and are useful for remembering the point of a specific ggame mechanism. Here’s how one looks in Python:
# This is a comment!
Simple, right? Well, yes they’re. Something to remember is that comments are ignored by the computer, and therefore, have no effect on your program. The question is: how do I add one in GKC block code? Simple as well! We just need to add a string and put our comment inside.
New word! String(s)
A string is just a data type, there are four main data types in most programming language(GKC block code as well): strings, integers, floats, and booleans. Don’t worry if you don’t understand those words, yet, I will later explain them all. Here’s an example of a string in Python:
print("Hello, world!")
'''print is a keyword/reserved word to do something like a command
the "Hello, world!" part is the string/text. It is what will be printed to the console(the activty
feed in GKC).
'''
Note:
I added a multi-line comment using triple ‘’ marks. We can’t really do this in GKC block code nor is it needed, but it is something to keep in mind.
Now here’s an example of a comment in GKC block code:
more to come posted early for some other post