Search Header Logo

DHS AP CSP Midterm Review

Authored by Christopher Jones

Computers

9th - 12th Grade

Used 20+ times

DHS AP CSP Midterm Review
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

100 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function reads a line of user input as a string in Python?

input()
read()
scan()
gets()

Answer explanation

`input()` returns a string from standard input.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does `print('A', 'B')` output by default?

AB
A B
A, B
['A','B']

Answer explanation

Multiple arguments to print are space-separated.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is a syntax error in Python?

print('hi')
x = 3
if True print('ok')
a_b = 1

Answer explanation

An `if` requires a colon and an indented block.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does `type(3.0)` return?

<class 'int'>
<class 'float'>
<class 'str'>
<class 'bool'>

Answer explanation

3.0 is a float.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is a valid Python comment?

// comment
# comment
/* comment */
<!-- comment -->

Answer explanation

Python uses `#` for single-line comments.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement is true about indentation in Python?

Optional for style only
Defines code blocks
Only required in functions
Only required in loops

Answer explanation

Indentation defines block structure in Python.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens with `print('5' + '6')`?

11
56
TypeError
None

Answer explanation

String concatenation yields '56'.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?