Search Header Logo

Python 101 Final Test

Authored by Erkingul Andakulova

Computers

9th - 12th Grade

Used 7+ times

Python 101 Final Test
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

40 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following makes the character fire if there is an enemy ahead? Mark all that apply.

if enemy_in_sight() :

long_jump()

if not enemy_in_sight() :

fire()

if enemy_in_sight() :

fire()

if enemy_in_sight() :

forward()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which part of a conditional goes after the if keyword and before the colon?

  • The word “if”

  • The word “else”

  • The code to run


The condition

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When would you use an "if-else" statement over an "if" statement?

  • When you want to stop running code once the condition is false

When you want to run different code if a condition is false

  • When you want to run code and then check if the condition is true after


  • They have the exact same function


4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The following pieces of code are the exact same in functionality.

  • True

False

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

If you wanted to run different code given different conditions, how would you do that?


  • Combine all the conditions in one condition using “or”


Use “elif” statements


  • Put everything in the “else” statement


  • Create two functions


6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When running this code, what will the character do if there is an enemy?

if not enemy_in_sight() :

fire()

  • fire

nothing

  • walk forward


  • jump

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of this code?

  • hello

  • world

hello

world

  • goodbye

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?