Intro to CS Unit 3 Review

Intro to CS Unit 3 Review

9th - 12th Grade

25 Qs

quiz-placeholder

Similar activities

Introduction to Programming

Introduction to Programming

9th - 12th Grade

25 Qs

Python year 9

Python year 9

8th - 11th Grade

20 Qs

2.2 Programming Techniques

2.2 Programming Techniques

10th Grade

20 Qs

Test 3 Review

Test 3 Review

9th - 12th Grade

25 Qs

AP CSP Unit 7: Parameters, Returns, and Libraries

AP CSP Unit 7: Parameters, Returns, and Libraries

9th - 12th Grade

26 Qs

Comprog - (Review) - October 24, 2022

Comprog - (Review) - October 24, 2022

11th Grade

25 Qs

Year 9 assessment

Year 9 assessment

9th Grade

22 Qs

CS Python Fundamentals Unit 3 Review

CS Python Fundamentals Unit 3 Review

9th - 12th Grade

20 Qs

Intro to CS Unit 3 Review

Intro to CS Unit 3 Review

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Sammi McConnell

Used 15+ times

FREE Resource

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When do you use an else statement?

To Input a variable

To handle string values

To tell what will happen when an if-statement is false.

To end an IF statement.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Write the code to test if num1 and num2 are the same.

if (num1 = num2)

if (num1 < num2)

if (num1 == num2)

if (num1 != num2)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1. Consider the following code:

word = "kangaroo"

if (word == KANGAROO"):

print ("TRUE")

else:

print ("FALSE")


What is output?

KANGAROO

TRUE

FALSE

CAPTAIN

Answer explanation

Capitalized words in a string are not equal to their lower case counter parts. So,​

“kangaroo” does not

equal “KANGAROO” which is why the output is false

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

3. Consider the following code:


if (90 < = x <= 100)


It should be rewritten as:

if (90 < = x <= 100):

if (90 < = x and <= 100):

if (90 < = x and x <= 100):

Nothing, the if statement is correct

Answer explanation

This correctly tests if 90 is less than or equal to x and tests if x is less than or equal to 100

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When do you use an else statement?

When you need something to happen when the if condition is false

To make a follow-up True/False decision

To allow programs to make decisions.

To get user input

Answer explanation

An else statement will run lines of code when all of the other conditions that are checked are false

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Write the code to test if num1 and num2 are NOT the same.

if (num1 != num2 )

if (num1 == num2 )

if (num1 = num2)

if (num1 < num2 )

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does != mean?

equal

not equal

less than

both

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?