5.1 Tools and Code Analysis Flashcards
Explain the basic concepts of scripting and software development.
What is an if statement?
Also known as a conditional or a logic statement, an if statement relies on certain conditions being true in order to proceed.
What are while and for loops?
While loops execute code while some condition is true and stops executing code when the condition becomes false.
For loops iterate through code a specific number of times, depending on what you specify.
What are the 3 most common operators in scripting?
Boolean, Arithmetic and String operators.
What is JavaScript Object Notation (JSON)?
JSON is an open standard data encoding format of data representation that can be used and manipulated easily with scripts. It is designed to be human-readable and machine processable. It is based on JavaScript concepts but is entirely script and language dependant.
What is a key-value pair?
A key-value pair is made of a key name and a value of that key separated by a colon, where:
-Keys must be text in double quotes
-Strings must be included in double quotes
-Data must be separated by commas
-If the data is an object, it must be bounded by curly brackets
-If an array is used, square brackets must be used
What are lists and dictionaries in Python?
A list is data enclosed in square brackets and separated by commas.
A dictionary in Python is an object made up of key-value pairs enclosed in curly-brackets and separated by commas.
What is a Comma-Separated Value (CSV) file?
A CSV file is a file where entries are separated by commas. It is a very popular way to import and export data.
What are Trees in data representation?
In a Tree structure, the root is at the top, and the ‘branches’ go down, with a ‘leaf’ object at the end of a branch. The tree depth is the number of hops from leaf to root.
What are Functions?
Functions, or Procedures, allow you to group a block of code under a name and call this named function whenever you like. They usually take some arguments as parameters, perform some processing, and typically return some output.
What are Classes?
A class is a user-defined prototype or template from which objects can be created. Classes allow you to bundle data and functionality together. A class creates user-defined data structures, which can hold their own functions.
What are Modules?
Modules are a way to code re-usable functions, variables, and classes that can be imported into your scripts. Python has built-in libraries of modules that can easily be referenced in your scripts.