Chapter 1: Python Primer Flashcards
Python is an interpreted language, true or false?
true
interpreted language
a high-level language run by an interpreter, a program that directly executes instructions written in the programming or scripting language without first compiling it into machine code
machine code (x2)
1) any low-level programming language, which consists of machine language instructions that are used to control a computer’s CPU (central processing unit)
2) a numerical language designed to run as fast as possible
high-level programming language (x3)
1) any programming language with strong abstraction from the computer
2) closer to human languages (easier to read) and further from machine languages
3) focuses more on logic than underlying hardware components (eg. memory management)
examples of high-level programming languages (x10)
1) Python
2) PHP
3) Perl
4) Java
5) JavaScript
6) C#
7) C++
8) Ruby
9) Rust
10) GO
What does IDE stand for?
integrated development interface
IDE (integrated development environment)
a software application for building applications that combines developer tools into a single GUI (graphical user interface)
delimiter
a unique character or series of characters that indicates the beginning or end of a specific statement, string or function body set
examples of delimiters (x4)
1) Round brackets or parentheses: ( )
2) Curly brackets: { }
3) Double or single quotes for string literals: ‘ ‘ “ “
4) Escape sequence for comments: /*
Python is an object-oriented language, true or false?
true
object-oriented language
a language that uses classes and objects to create models
temperature = 98.6 is an example of an _____ statement
assignment
temperature = 98.6
in this example, temperature is an _____ (also known as name)
identifier
temperature = 98.6
in this example, 98.6 is an _____
object
temperature = 98.6
in this example, the identifier (also known as name) _____ references an instance of the _____ class having value _____
temperature
float
98.6
identifiers are case-sensitive in Python, true or false?
true
an identifier is implicitly associated with the _____ _____ of the object to which it refers
memory address
Python is a dynamically typed language, true or false?
true
dynamically typed language (x2)
any language that does not require declaring the data type of a variable
the variable type of checked during runtime
alias
a second identifier (also known as name) to an existing object
temperature = 98.6 original = temperature
in this example, original is an _____
alias
temperature = 98.6 original = temperature
in this example, identifiers temperature and original reference the same object 98.6, true or false?
true
temperature = 98.6 original = temperature
in this example, either identifier temperature or original can be used to access the 98.6 object, true or false?
true
if an object supports behaviors that affect its state, changes through an alias will be apparent when using the other identifier, true or false?
why is this so?
true
both identifiers refer to the same object
temperature = 98.6 original = temperature temperature = temperature + 50
the temperature identifier has been assigned to a new value, while original continues to refer to the previously existing value, true or false?
true
temperature = 98.6 original = temperature temperature = temperature + 50
what is the value of the floating-point object original references?
what is the value of the floating-point object temperature references in the last line?
- 6
103. 6
instantiation
creating a new instance of a class
the syntax for instantiating an object to invoke the _____ of a class
constructor
syntax of a constructor of a class
the class name followed by parentheses
constructor of a class (x3)
a special member function of a class that is executed when a new object of that class is created (also known as instantiated)
it has the same name as the class
it does not have any return type, not even void
w = Widget()
in this example, the constructor does not require parameters, true or false?
true
w = Widget(a, b , c)
in this example, the constructor requires parameters, true or false?
true