Skip to Main Content

DH Boot Camp for Librarians

Resources for the Digital Scholarship Services Librarians' Boot Camp.

Key Terms

casting: Converting one type of data to another.  Remember that you can't add a string and an integer, for example, in Python; you have to cast the string to an integer in order to use it in any mathematical expression.  For example, if the string "x" is set to "12", you need to use int( ) to cast it: y = 4 + int(x). This is also called type conversion.

comment: A human-readable piece of text inserted in a program.  Comments are meant to improve the readability of code and do not affect its execution.  Treat comments as explanatory notes to yourself or to collaborators.

control structure: A piece of code that decides what happens next in your program.  if/else statements are common types of control structures.

data structure: A variable that contains more than one piece or type of information.  In python, dictionaries are a good example of a data structure.  Data structures often implement abstract data types like lists and queues. 

Python: A general-purpose interpreted programming language.  It has many properties that make it ideal for learning to code and for working with texts.

REPL: Read, evaluate, print, loop: the basic model for entering commands in the Python shell (and the bash shell, for that matter).  This concept is where repl.it gets its name.

runtime error: An error in programming that isn't related to syntax.  For example, trying to slice an integer in Python is a runtime error, not a syntax error (the code is correctly formed but attempts an illegal operation).

statement: An instruction to the computer -- typically a single line of code.  Programs are composed of statements.

variable: A named place to store data.  Variables can have different types -- numerical, textual, floating point -- but all of them have a name and a value, and in Python, the value can be modified at any time.  If you create a variable that depends on the value of another variable, the value of your created variable won't change when you update the dependent value.

slicing: A special way of extracting substrings in Python.  It looks like subscripting, but follows the syntax variable_name[start:stop], where start is the index of the first character to include in the substring and stop is the index of the character after the last character we want to include.  

syntax/syntax error: A description of the rules that code has to follow.  Syntax in programming is generally strict, and erroneous syntax will cause your program to fail with a syntax error.

zero-indexing: A method of counting elements that treats the first item in a list as #0.  Python strings (and other data structures) are zero-indexed, so character 0 in the string "library" would be "l".

Online Resources & Citations