Upgrade to remove ads
Intro to computer sci. vocab.
Terms in this set (7)
a character or thing that can perform actions. Objects are the building blocks of Python. They are things or characters that can perform actions. Your hero is an object. It can perform the moving actions. In hero.moveRight(), the object is hero. In Course 2, students will also be using the pet object to perform actions.
an action performed by an object. Functions are actions an object can do. moveRight() is a function. Function names are always followed by parentheses.
additional information for a function. Arguments are what we put inside the parentheses of a function. They tell the function more information about what it should do. In hero.attack(enemy), enemy is the argument.
code that repeats. A loop is a way of repeating code. One way of writing loops uses the keyword while, followed by an expression that can be evaluated as True or False.
a holder for data. A variable holds your data for later. You create a variable by giving it a name, then saying what value it should hold.
the building block of modern programming, the conditional. It's named as such because of its ability to check the conditions at the moment and perform different actions depending on the expression. The player is no longer able to assume there will be an enemy to attack, or if there is a gem to grab. Now, they need to check whether it exists, check if their abilities are ready, and check if an enemy is close enough to attack.
an object representing something that happened. Students can write code to respond to events: when this type of event happens, run this function. This is called event handling, and it's a very useful programming pattern and an alternative to an infinite while-loop.
You might also like...