Intro to Python Final Exam

studied byStudied by 1 person
5.0(1)
Get a hint
Hint

A reusable chunk of code with inputs and outputs

1 / 72

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

73 Terms

1

A reusable chunk of code with inputs and outputs

Function

New cards
2

A name that can be associated with a value

Variable

New cards
3

A control structure for performing actions on each element of a sequence

For loop

New cards
4

A control structure for branching the execution of a program

If statement

New cards
5

A data structure for mapping keys to values

Dictionary

New cards
6

A data structure for storing elements in an ordered sequence

List

New cards
7

A categorization of values of similar kinds that determines what you can do with the values

Type

New cards
8

A sequence of data stored in your computer's long term memory

File

New cards
9

Specific instances of data written directly in source code

Literal value

New cards
10

A type that represents textual data

String

New cards
11

A collection of functions, classes, and variables available to be imported

Module

New cards
12

A combination of data and functions that can encapsulate behavior into a new type

Class

New cards
13

An instance of a class

Object

New cards
14

A sequence of coded instructions that manipulate data inside a computer

Program, While, or Method

New cards
15

"2.0"

String

New cards
16

"Python"

String

New cards
17

-1.4

Float

New cards
18

[1, 2, 3]

List

New cards
19

''

String

New cards
20

{}

Dictionary

New cards
21

True

Boolean

New cards
22

None

None

New cards
23

[]

List

New cards
24

{1:2}

Dictionary

New cards
25

"True"

String

New cards
26

-100000257

Integer

New cards
27

(1, 2, 3)

Tuple or Set

New cards
28

While

Keyword

New cards
29

Boolean

Type

New cards
30

Float

Type

New cards
31

for

Keyword

New cards
32

print

Built in function

New cards
33

class

Keyword

New cards
34

Integer

Type

New cards
35

in

Keyword

New cards
36

map

Built in function

New cards
37

def

Keyword

New cards
38

Dictionary

Type

New cards
39

input

Built in function

New cards
40

import

Keyword

New cards
41

String

Type

New cards
42

return

Keyword

New cards
43

List

Type

New cards
44

Humans discovered programming languages in the 1940s and have been decoding them ever since.

False

New cards
45

The print function can only print literal values

False

New cards
46

Variables change their value over time according to instructions in a program

True

New cards
47

Variables in Python are used to solve for unknown values, like in Algebra

False

New cards
48

Variable names are important because computers understand the meaning of names and change their value accordingly

False

New cards
49

Normally, statements are executed from top to bottom

True

New cards
50

Expressions are always evaluated from left to right

False

New cards
51

Strings are composed of only letters and symbols

False

New cards
52

Printing is the same as returning

False

New cards
53

Every function created with the def keyword must have at least one parameter

False

New cards
54

You should not put error messages into help seeking emails because it can clutter up the email

False

New cards
55

You can nest if statements inside of other if statements, but not inside functions

False

New cards
56

The Iteration Variable will take on each value of the List Variable, one at a time

True

New cards
57

The body of a for loop will contain one statement for each element of the iteration list

False

New cards
58

Like an if statement and a function call, the for Loop might cause the execution to not follow the sequential order of lines

True

New cards
59

The statement count = count + 1 will cause an error because no number can be greater than itself

False

New cards
60

List comprehensions cannot express everything that a for loop can

False

New cards
61

Dictionaries will always have at least one key and one value

False

New cards
62

Dictionaries are useful because you can have duplicate keys

False

New cards
63

Variables can be used as the keys of a dictionary

True

New cards
64

Keys can be added to the dictionary after its been created

True

New cards
65

Lists can be composed of Dictionaries

True

New cards
66

Dictionaries cannot be composed of lists

False

New cards
67

Unlike Lists, Tuples are immutable, meaning Tuples cannot be changed after they are created

True

New cards
68

Tuples are composed of key/value pairs

False

New cards
69

A while loop will always be executed at least once

False

New cards
70

A while loop will execute once for each expression in the conditional

False

New cards
71

A for loop will process a file sentence by sentence

False

New cards
72

The open function consumes a string representing a path and returns a string of the file's contents

False

New cards
73

You must import the json module before you can use the load function

True

New cards

Explore top notes

note Note
studied byStudied by 91 people
... ago
5.0(2)
note Note
studied byStudied by 26 people
... ago
5.0(1)
note Note
studied byStudied by 15 people
... ago
5.0(1)
note Note
studied byStudied by 62 people
... ago
5.0(1)
note Note
studied byStudied by 16 people
... ago
4.0(1)
note Note
studied byStudied by 9 people
... ago
5.0(1)
note Note
studied byStudied by 15 people
... ago
5.0(1)
note Note
studied byStudied by 100 people
... ago
5.0(1)

Explore top flashcards

flashcards Flashcard (156)
studied byStudied by 7 people
... ago
5.0(1)
flashcards Flashcard (37)
studied byStudied by 7 people
... ago
5.0(2)
flashcards Flashcard (54)
studied byStudied by 31 people
... ago
5.0(1)
flashcards Flashcard (45)
studied byStudied by 88 people
... ago
5.0(2)
flashcards Flashcard (166)
studied byStudied by 6 people
... ago
5.0(1)
flashcards Flashcard (31)
studied byStudied by 7 people
... ago
5.0(1)
flashcards Flashcard (111)
studied byStudied by 169 people
... ago
5.0(2)
flashcards Flashcard (169)
studied byStudied by 13 people
... ago
5.0(1)
robot