Midterm Flashcards

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
Q

The ‘for’ loop repeats tasks, but not based on a condition, instead, based on ________ (an ordered list of things)

A

Sequence

26
Q

You can use the _________ statement to cause early termination.

A

Break

27
Q

The break statement causes the execution to immediately exit the _____ block and continue with the next statement after the _____ block, if any.

A

While

28
Q

You can use the ______ statement to skip certain iteration.

A

Continue

29
Q

The ________ statement causes the exectuion to skip the rest of the statements within the while block for that iteration.

A

Continue

30
Q

The ________ module contains functions related to generating random number and producing random results.

A

random

31
Q

What function is used to produce a random integer?

A

randrang()

32
Q

What does range() function generate?

A

Lists containing arithmetic progressions.

range([start,] stop[, step) -> list of integers

33
Q

A special kind of variable used to store a series of elements that usually contain related information

A

List

34
Q

In a list, do all the elements to have the same data type?

A

No, they do not

35
Q

In a list, each of the elements is identified by its _______.

A

index

36
Q

List methods

A
append(value)
sort()
reverse()
count(value)
index(value)
insert(i, value)
remove(value)
37
Q

Tuple can be changed after creation, T or F?

A

False, Tuple can NOT be changed after creation

38
Q

A sequence of elements (any type)

A

Tuple

39
Q

In dictionary, data are enclosed within ________.

A

curly braces {}

40
Q

What is Dictionary?

A

Another Python container type for storing data in key/value pairs (no index, tracked by key)

41
Q

Another Python container type for storing data in _________ pairs.

A

key/value

42
Q

To create/track/modify item in dictionary, we need to use _________.

A

square brackets []

43
Q

What is a shared reference?

A

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
Q

What is Function commonly used for?

A

To group a series of statements together to achieve a specific objective.

45
Q

How to define a function?

A

Use def, followed by function name, followed by a pair of parentheses, followed by a colon and then an indented block of statements

46
Q

What are optional parameters?

A

Parameters with default values

47
Q

Function parameters/arguements.

A

The data type of Input(s) should be same as the type of the parameter(s) the function defines

48
Q

By default, all functions return _________.

A

None

49
Q

Three types of errors?

A
  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
Q

Complete statements used to handle exceptions?

A

Try, except, else, finally

51
Q

Debug tool?

A

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
Q

Helps you to run the code at normal speed until it reaches a certain line?

A

Breakpoint

53
Q

A _________ is set on a line when you want the debugger to take control once execution reaches that line.

A

Breakpoint

54
Q

You can set breakpoints on as many lines as you want, T or F?

A

True

55
Q

Python code elements?

A
  1. Statement (sentence)
  2. Function (paragraph)
  3. Module (chapter)
  4. Project (book)
56
Q

Define variable scope.

A

The scope of a variable is the region of the program in which it is accessible.

57
Q

Variable scopes?

A

Global, Module, Function

58
Q

Pathnames defined as strings should use two backslash () a single ________.

A

Forward slash (/)

59
Q

Pathnames are always stored as ______ in Python.

A

Strings

60
Q

OOP

A

Object-Oriented Programming - a programming paradigm that uses “objects” to design applications and computer programs

61
Q

Established paradigms in OOP

A
  1. Abstraction
  2. Encapsulation
  3. Inheritance
  4. Polymorphism
62
Q

Anything that can be seen or touched. Objects have _________ and _________ (behaviors)

A

attributes, methods