Quiz 0 Review

0.0(0)
studied byStudied by 1 person
0.0(0)
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/60

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

61 Terms

1
New cards

Which of the following are true of expressions? check all that apply

a. every expression will evaluate to a value

b. every expression evaluates to a specific type

c. anywhere you can write an expression that evaluates to one type, you could write another expression in its place as long as it evaluates to the same type and still have a validly types program

all is true

2
New cards

In the following expressions which operator would be evaluated first using standard order of operations?

1 + 2 / 4 * 5 - 6

/

3
New cards

which operator is used to raise on number to the power of another

**

4
New cards

which operator is used for integer division and results in an int typed value

//

5
New cards

which operator is used to find the remainder of an integer division calculation and results in an int typed value

%

6
New cards

which of the following boolean expressions results in a value of False? check all that apply

a. 1 > 0

b. 1 > 1

c. 1 > 2

d. 1 >= 0

e. 1 >= 1

f. 1 >= 2

b, c, f

7
New cards

what is the result of evaluating the expression "A" > "b"

False

8
New cards

True or False: Comparing two string values using relational operators always works the way you would expect it to in the English language

False

9
New cards

which relational operators tests whether two values are equal to one another?

==

10
New cards

what does the final variable access expression evaluate to in this sequence of statements?

>>> x: int = 1

>>> x = x + 1

>>> x

2

11
New cards

what does the final type function call evaluate to In this sequence of statements?

>>> course: str = "110"

>>> type(int(course))

int

12
New cards

>>> from random import random

>>> random( )

what type does a call to the random function evaluate to?

13
New cards

>>> from random import choice

>>> choice("wxyz")

what type does a call to the choice function evaluate to in this example

14
New cards

how many different patterns can be formed with 16 bits?

2^16

15
New cards

in the following function call expression, which symbol is an argument?

int(0b01000001)

0b01000001

16
New cards

what is the type of True

boolean

17
New cards

what is the evaluation of

1_000 + 1_000_000

1001000

18
New cards

what is the evaluation of

10 / 2

5.0

19
New cards

what is the evaluation of "U" + "N" + "C"

'UNC'

20
New cards

given the string "12345" what is the evaluation of "12345"[0]

'1'

21
New cards

what is the evaluation of

"spooky season"[2 + 2]

'k'

22
New cards

what is the evaluation of "spooky"[len("spooky")]

error: string index out of range

23
New cards

what are the valid bool values in Python

True and False

24
New cards

when will you commonly use bool values in your program?

a. when performing computations

b. when working with textual data

c. when making logical decisions

d. bool values are uncommonly used in programs

c. when making logical decisions

25
New cards

true of false: a program is a sequence of steps

true

26
New cards

true or false: an algorithm is a set of instructions that is fixed in length and can only process a fixed amount of data

false

27
New cards

true or false: a low-level program is one whose format is primarily intended for humans to read and right

false

28
New cards

true or false: programming languages are designed by and for humans

true

29
New cards

what word describes the meaning implied by punctuation, spacing, words, rules, and names in your program?

semantics

30
New cards

true or false: the purpose of the interpreter is to read and evaluate the instructions we write in an interpreted language, such as python, so that our central processing unit can carry out our instructions

true

31
New cards

does syntax errors occur during the reading step or the evaluation step of the interpreter?

during the reading step of the interpreter

32
New cards

true or false: if your program has correct syntax it will not have any bugs

false

33
New cards

is the reading step or the evaluation step of the interpreter responsible for carrying out your instructions?

the evaluation step of the interpreter

34
New cards

where are the names of everything (identifiers, functions, class, etc.) defined the a process bound?

call stack

35
New cards

true or false: a built-in is a function whose name is bound an defined before the code of your program begins

True

36
New cards

true or false: the names you define in your code exist in the globals area

true

37
New cards

what layer of the computing system will the programs you write exist?

user space processes

38
New cards

which of the following is a "program in motion"?

a. CPU

b. Process

c. memory

d. storage

b process

39
New cards

what layer of the computing systems purpose is to make it easy for you as the user to start, control, and stop the processes running on a computing system

shell

40
New cards

which of the following kinds of shells exist? select all that apply

a. graphic user interface

b. textual (command-line interface)

a and b

41
New cards

what is the name of the program or VSCode pane that you use to run a textual shell?

terminal

42
New cards

what is the primary purpose of the operating system kernel?

a. to fairly share the resources of your machine

b. protects processes from each other

c. it is the layer of the system where your program exist

a and b

43
New cards

what are the three primary components of hardware were concerned with in this course

a. operating system

b. CPU

c. memory (ephemeral, fast)

d. storage (persistent, slower)

b, c, d

44
New cards

what part of the system is responsible for controlling what resources are available to processes?

OS kernel

45
New cards

true or false: when your program is running as a process, the process keeps track of what step of the instructions it is currently working on or needs to do next

true

46
New cards

true or false: when your program is running as a process, the process knows what memory it has available to it

true

47
New cards

which of the following int expressions could you use as an index to access the third character (c) of the string "abcdef". select all that apply

a. 0

b. 1

c. 2

d. 3

e. len("abcdef") - 1

f. len("abcdef") - 3

g. len("abcdef") - 4

c

g

48
New cards

what operation is taking place when the + operator is evaluated in the following expression

"100" + "10.0"

concatenation

49
New cards

true or false: there are no differences between float values and decimal values because floats are decimals

false

50
New cards

in the following expression, which operator will evaluate first?

(1 - 2) / 3 + 4 * 5 6

-

51
New cards

which of the following is a str literal?

a. fifty_percent

b. "0"

c. two

d. '3.14'

e. 1_100

f. "the quiz brown fox"

b, c, f

52
New cards

which of the following are float literals?

a. fifty_percent

b. 0

c. 0.0

d. "0"

e. 1

f. "3.14"

g. 110.0

c, g

53
New cards

what two kinds of expressions are demonstrated in the complex expression below? select both

sqrt(110)

a. literal

b. operators

c. variable access

d. function call

e. method call

54
New cards

true or false: the following two statements are equivalent to one another

a = b

vs.

b = a

false

55
New cards

the following expressions evaluates to what

"Zayn" > "harry"

False

56
New cards

true or false: the central processing unit of your computer is able to directly understand and follow the high-level python code you write

false

57
New cards

true or false: every bit pattern has a single, unique interpretation in all contexts

false

58
New cards

when you open your terminal in VSCode and type a command such as python, what kind of software are you most directly interacting with in order to start a new python process?

a. User Space programs

b. Shell

c. Operating Systems

d. Hardware

b

59
New cards

true or false: the expressions you write in a program evaluate as you are typing them into a .py file

false

60
New cards

which of the following data types is subscription ("indexing") syntax valid with? select all that apply

a. bool

b. str

c. int

d. float

b

61
New cards

true or false: 0101 is an int literal

false

int literals can be 0 or a nonzero digit followed by zeros

Explore top flashcards

Properties of Solids
Updated 768d ago
flashcards Flashcards (28)
poli 355 post midterm
Updated 305d ago
flashcards Flashcards (115)
Unit 8 Vocab
Updated 545d ago
flashcards Flashcards (141)
Archetypes
Updated 26d ago
flashcards Flashcards (60)
ems final 👎
Updated 1041d ago
flashcards Flashcards (70)
Muscular System
Updated 586d ago
flashcards Flashcards (69)
Properties of Solids
Updated 768d ago
flashcards Flashcards (28)
poli 355 post midterm
Updated 305d ago
flashcards Flashcards (115)
Unit 8 Vocab
Updated 545d ago
flashcards Flashcards (141)
Archetypes
Updated 26d ago
flashcards Flashcards (60)
ems final 👎
Updated 1041d ago
flashcards Flashcards (70)
Muscular System
Updated 586d ago
flashcards Flashcards (69)