Computer Science

Ace your homework & exams now with Quizwiz!

bits

0s and 1s are known as ___ .

%

15 _____ 3 = 0

case sensitive

A language is called _____ when upper case letters in identifiers are considered different from lower case letters.

instructions

A processor is a circuit that executes a list of _____.

An Algorithm

A sequence of instructions that solves a problem is called _____.

interpreter

A(n) _____ is a program that executes a script.

argument

An item passed to a function is a(n) _____ .

math.sqrt(math.pow(a, 2)) + math.pow(b, 2)))

Assume a and b are variables that hold the base and height of a right triangle. The length of the long side (hypotenuse) is calculated as the square root of a^2 + b^2. Which expression calculates the length of the hypotenuse?

output

Basic instruction types are input, process, and _____.

's'

If text_line = 'one fish two fish', what is the value of text_line[6]?

operating system

The _____ is a process that manages programs and interfaces with peripherals.

compound

The operator *= is called a(n) _____ operator.

escape sequence

The special two-item character sequence that represents special characters like \n is known as a(n) _____.

print(emails_dict["C2104"])

The variable emails_dict is assigned with a dictionary that associates student ids with email addresses. Which statement prints the email address associated with the student id "C2104"?

int()

Which function converts a string to an integer?

companies.remove('Google')

Which of the following statements removes the value 'Google' from the set, companies? companies = { 'Apple', 'Microsoft', 'Google', 'Amazon' }

_ (underscore)

Which of the following symbols can be used as part of an identifier?

dict

Which pair shows the correct classification of the given data type?

print(sys.argv)

Which print statement displays the value of a variable called argv in a module called sys?

#

Which symbol is used in Python to create a comment?

Garbage collection

_____ is the process where objects that are no longer needed are deleted.

/

15 _____ 3 = 5.0

key

A _____ can be located in a dictionary and is associated with a value.

disk

A _____ is a computer component that stores files and other data.

variable

A _____ is a named item used to hold a value.

keyword

A _____ is a word that is part of the Python language and can't be used as a variable name.

unary

According to Python's precedence rules, which of the following operators has the highest precedence?

overflow

Assigning a value to a floating point variable that is too large for the computer to represent is a condition called _____ .

backwards compatible

Because Python 2.7 programs cannot be run by the Python 3.0 interpreter, Python 3.0 is not _____.

Which statement about Python is true?

Developers are not usually required to pay a fee to write a Python program.

associative

Dictionaries are containers used to describe a(n) _____ relationship.

runtime

Dividing by zero is an example of which type of error?

3.0004e-12

In Python, which of the following literals is shown in valid scientific notation?

variables

In an instruction like: z = x + y, the symbols x, y, and z are examples of _____.

prompt

In the statement: age = input('Enter your age: ') , the string 'Enter your age: ' is called a(n) _____.

immutable

Objects like integers and strings that can't be modified are called _____ .

What is an IDE used for?

Program development, including writing the source code.

Random Access Memory

RAM is an abbreviation that stands for:

whitespace

Space, tab, and newline are all called _____ characters.

1980

The Python language began development in the late _____'s.

open-source

The Python language is developed by a public community of users, therefore Python is a(n) _____ language.

id()

The built-in Python function that gives an object's identity is:

Moore's Law

The capacity of ICs doubles roughly every 18 months

interest = (principal * interest) * time

The formula for calculating the amount of interest charged on a loan is: interest = [principal x rate of interest] x timeWhich Python statement correctly performs the interest calculation?

['one', 'two', 'three', '1', '2', '3']

What are the contents of names_list after the following code is executed? names_list = ['one', 'two', 'three'] digits_list = ['1', '2', '3'] names_list = names_list + digits_list

one\two\\three

What does print("one\\two\\\\three") display?

code

What is a common word for the textual representation of a program?

0

What is displayed when the following code is executed?

1.0

What is the ending value of z? x = 0.3 z = math.pow(math.ceil(x), 2)

float

What is the name of the data type used for floating point numbers

17

What is the output? my_list = [2, 8, 3, 1, 18, 5] print(my_list[3] + my_list[1] * 2)

An error: the string does not represent an integer value

What is the result of the expression: int('1750.0')?

5

What is the value of 11 // 2?

_main_

What is the value of the __name__ built-in variable in a module that is executed as a script by the programmer?

-2

What is the value of x after the following code is executed? x = 15 x = x + 1 x = x * 2 x = 30 - x

12

What is the value of y after the following code is executed? Note that the question asks for y, not x.

2.5

What is the value of: 1 + int(3.5) / 2?

{1, 2, 3, 4, 5, 6}

What values are in result_set after the following code is run? my_set = {1, 2, 3, 4, 5, 6} other_set = {2, 4, 6} result_set = my_set.union(other_set)

{ }

What values are in result_set after the following code is run? my_set = {1, 2, 3, 4, 5, 6} other_set = {2, 4, 6} result_set = other_set.difference(my_set)

(x * y) / 2

Which code example is an expression?

list

Which data type is the correct choice to store a student's test scores in chronological order?

set

Which data type is the correct choice to store the names of all the hockey players who have scored 3 or more goals in a single game in no specific order?

dict

Which data type is the correct choice to store the number of wins associated with each basketball team in the NBA?

(float(first_num) + float(second_num)) / 2

Which expression calculates the average of first_num and second_num? first_num = input('Enter the first number: ') second_num = input('Enter the second number: ')

seconds // 60

Which expression gives the number of whole minutes that corresponds to some number of seconds?

x - ((y * (-z)) / 3)

Which expression using parentheses is equivalent to the following expression: x - y * -z / 3

2.3e7

Which floating-point literal correctly represents the scientific notation value: 2.3 x 10^7?

d

Which formatting presentation type is used to display an integer?

print()

Which instruction displays variables or expression values?

print(len(sales["apples"]))

Which line in the following program causes a runtime error? sales = { "apples": 0, "lemonade": 0 } sales["apples"] = sales["apples"] + 1 del sales["lemonade"]print(len(sales["apples"]))

my_list = [7, 2, -8, 16]

Which of the following assignment statements creates a list with 4 integer elements?

The speed of a snail.

Which of the following data values is best represented with a floating point variable?

7.5 + (x / 2)

Which of the following expressions causes an implicit conversion between types? Assume variable x is an integer, t is a float, and name is a string.

max_age

Which of the following identifiers is valid?

2x + 3y

Which of the following is NOT a valid expression? Assume x and y are integer variables.

The element at index 1 is 'JFK'

Which of the following statements about my_list is false?

my_set = set([1, 2, 3])

Which of the following statements assigns a new variable, my_set, with a set that contains three elements?

age + 2 = years

Which of the following statements has a syntax error? Assume age and years are variables that have already been defined.

string_1[1] = 'B'

Which of the following statements produces an error? Assume string_1 = 'abc' and string_2 = '123'.

print(r'C:\\Users\\Mika\\grades.txt')

Which print statement would display 'C:\Users\Mika\grades.txt' (without the single quotes)?

print(chr(65))

Which print statement would display the letter 'A'? (Note that the code point for the letter 'A' is 65.)

print('I won\'t quit!')

Which print statement would display: I won't quit!

IDLE editor

Which program can be used to create a Python file that can be used directly by the interpreter?

ValueError

Which runtime error type occurs when trying to convert 'abc' to an integer?

airport_code = 'JFK'

Which statement assigns the string variable airport_code with the value JFK?

fruits_dict["Lemon"] = 0.75

Which statement changes the value associated with key "Lemon" to 0.75 in the dictionary fruits_dict?

List items can be changed, while tuple items can't be changed.

Which statement correctly explains a difference between lists and tuples?

print('First part...', end='')

Which statement does not print a newline character at the end?

x + y = z

Which statement has a syntax error? Assume variables x, y, z, and age have already been defined.

x = x - (2 + y)

Which statement is equivalent to the following assignment? x -= 2 + y

pop() removes a random item in the set.

Which statement is true regarding the pop() method for sets?

import math

Which statement makes the code in the math module available?

print("I won't quit!")

Which statement outputs the text: "I won't quit!"?

user_name = input()

Which statement reads a user-entered string into variable user_name?

del cars_dict["1G1JB6EH1E4159506"]

Which statement removes entry "1G1JB6EH1E4159506" from the dictionary cars_dict?

my_list.pop(len(my_list)-1)

Which statement removes the last element of my_list?

*

Which symbol represents the multiplication operation in programming?

logic error

Which type of error does not cause the program to crash?

compiler

Which type of program converts a high-level language program into machine instructions?

len(my_list)

hich method call returns the number of elements in my_list?


Related study sets

Competing the Application, underwriting and deliving the policy

View Set

Statistics Chapter 8: Sampling Methods and the Central Limit Theorem)

View Set

BUS 311 Excel Chapter 5 TESTBANK QUIZ

View Set

ITC203 Wk 5 Designing the User Interface

View Set

Chapter 7 Consumer Behavior MKT 3323

View Set

MGT 327 Chapter 5 Insourcing and Outsourcing

View Set