Part 2 - Python CodeHS Standards: Number Guessing Game

Part 2 - Python CodeHS Standards: Number Guessing Game

10th Grade

10 Qs

quiz-placeholder

Similar activities

Scope of Variables in Python

Scope of Variables in Python

1st Grade - Professional Development

15 Qs

Boolean expressions

Boolean expressions

5th - 12th Grade

15 Qs

Practice for 8th AP Java Quiz

Practice for 8th AP Java Quiz

10th - 12th Grade

14 Qs

BJC U2L1 Global vs. Local Variables

BJC U2L1 Global vs. Local Variables

10th Grade - University

11 Qs

year 8 lesson 2 quiz - python

year 8 lesson 2 quiz - python

8th - 10th Grade

14 Qs

While loop

While loop

3rd Grade - University

9 Qs

Java Arrays Basic

Java Arrays Basic

10th - 12th Grade

15 Qs

Penilaian Harian 1 Ms. Excel (Kondisi IF)

Penilaian Harian 1 Ms. Excel (Kondisi IF)

1st - 12th Grade

10 Qs

Part 2 - Python CodeHS Standards: Number Guessing Game

Part 2 - Python CodeHS Standards: Number Guessing Game

Assessment

Quiz

Computers

10th Grade

Hard

Created by

PRESTON COLE

Used 6+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

In the context of a number guessing game, examine the following block of code. What will be the output if guess is "15.0" and number is 15?

Correct Guess!

Incorrect Guess!

Syntax Error

TypeError

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider a guessing game where number is a randomly selected integer between 1 and 100, and guesses is a list of guessed numbers. Which of the following snippets will efficiently check if the most recent guess is correct?

Media Image
Media Image
Media Image
Media Image

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a guessing game, you want to limit the number of guesses to 3. Which of the following loop structures is the best way to achieve this?

Media Image
Media Image
Media Image
Media Image

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Analyze the following code snippet in the context of a number-guessing game. What type of error will the below code raise?

IndexError

TypeError

SyntaxError

KeyError

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

In a guessing game, what will the following code snippet output if guess is '15' and number is 15?

Correct!

Incorrect!

Syntax Error

AttributeError

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a number-guessing game, how can you ensure that the variable guess is of type int before processing it?

assert type(guess) == int

if isinstance(guess, int): pass

try: guess = int(guess)

guess = int(input())

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Given the code below, which is intended to iterate through a 2D list of guesses, how would you access the second element from the third sublist in guesses_2D?

guesses_2D[2][1]

guesses_2D[3][2]

guesses_2D[2][2]

guesses_2D[1][2]

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?