Midterm Flashcards

(62 cards)

1
Q

What does IDLE stand for?

A

Integrated Development Learning Environment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is used to write and save Python code?

A

Script window

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does IDE consist of?

A
  1. Source code editor
  2. Build automation tools
  3. Debugger
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does a variable name contain?

A

Numbers, letters and underscores ONLY. (Can NOT start with a number)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are python keywords reserved for?

A

Internal use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How are variables in Python typed?

A

Dynamically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In mathematical operations, ______ matters.

A

Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Python is case sensitive, T or F?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What kind of language is Python?

A

Interpreted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Python scripts can be produced without an external development environment, T or F?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is ArcGIS Engine used for?

A

To deploy GIS data, maps, and geoprocessing scripts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Common data types? (variable declaration)

A

int, float, string and bool

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to concatenate two strings together?

A

With the + operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

\ prints?

A

one backslash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

' prints?

A

A single quote

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

" prints?

A

A double quote

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

\n

A

new line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

string functions

A

upper()
lower()
len()
str()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

str()

A

Returns a string value of input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

len()

A

Returns the length of a string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Every letter in a string has an index, starts from?

A

0 (left to right)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Sequences fall into one of two categories:

A

Mutable or changeable

Immutable or unchangeable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Strings are immutable, T or F?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

To print without a newline, add a _______ after the last object.

A

Comma

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
The 'for' loop repeats tasks, but not based on a condition, instead, based on ________ (an ordered list of things)
Sequence
26
You can use the _________ statement to cause early termination.
Break
27
The break statement causes the execution to immediately exit the _____ block and continue with the next statement after the _____ block, if any.
While
28
You can use the ______ statement to skip certain iteration.
Continue
29
The ________ statement causes the exectuion to skip the rest of the statements within the while block for that iteration.
Continue
30
The ________ module contains functions related to generating random number and producing random results.
random
31
What function is used to produce a random integer?
randrang()
32
What does range() function generate?
Lists containing arithmetic progressions. | range([start,] stop[, step) -> list of integers
33
A special kind of variable used to store a series of elements that usually contain related information
List
34
In a list, do all the elements to have the same data type?
No, they do not
35
In a list, each of the elements is identified by its _______.
index
36
List methods
``` append(value) sort() reverse() count(value) index(value) insert(i, value) remove(value) ```
37
Tuple can be changed after creation, T or F?
False, Tuple can NOT be changed after creation
38
A sequence of elements (any type)
Tuple
39
In dictionary, data are enclosed within ________.
curly braces {}
40
What is Dictionary?
Another Python container type for storing data in key/value pairs (no index, tracked by key)
41
Another Python container type for storing data in _________ pairs.
key/value
42
To create/track/modify item in dictionary, we need to use _________.
square brackets []
43
What is a shared reference?
A variable refers to a value. It doesn't store a copy of a value, but refers to the place in the computer's memory where the value is stored.
44
What is Function commonly used for?
To group a series of statements together to achieve a specific objective.
45
How to define a function?
Use def, followed by function name, followed by a pair of parentheses, followed by a colon and then an indented block of statements
46
What are optional parameters?
Parameters with default values
47
Function parameters/arguements.
The data type of Input(s) should be same as the type of the parameter(s) the function defines
48
By default, all functions return _________.
None
49
Three types of errors?
1. Syntax error (easy) - code is wrong 2. Exception (hard) - during runt time, a statement is impossible to carry out 3. Logic (harder) - code doesn't produce the expected result
50
Complete statements used to handle exceptions?
Try, except, else, finally
51
Debug tool?
Go - run the code as the Debugger is not turned on Step - Run the code line by line Over - Debugger will not step into function it calls Out - jump out of the function it is in Quit - stop running the code
52
Helps you to run the code at normal speed until it reaches a certain line?
Breakpoint
53
A _________ is set on a line when you want the debugger to take control once execution reaches that line.
Breakpoint
54
You can set breakpoints on as many lines as you want, T or F?
True
55
Python code elements?
1. Statement (sentence) 2. Function (paragraph) 3. Module (chapter) 4. Project (book)
56
Define variable scope.
The scope of a variable is the region of the program in which it is accessible.
57
Variable scopes?
Global, Module, Function
58
Pathnames defined as strings should use two backslash () a single ________.
Forward slash (/)
59
Pathnames are always stored as ______ in Python.
Strings
60
OOP
Object-Oriented Programming - a programming paradigm that uses "objects" to design applications and computer programs
61
Established paradigms in OOP
1. Abstraction 2. Encapsulation 3. Inheritance 4. Polymorphism
62
Anything that can be seen or touched. Objects have _________ and _________ (behaviors)
attributes, methods