Search Header Logo

Python Revision

Authored by Chloe Wilkes

Computers

8th Grade

Used 21+ times

Python Revision
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is a comment?

" this is a comment "

# this is a comment

this is a comment

# this is a comment #

Answer explanation

Media Image

Comments start with a #. " initiates a string.

2.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Find the invalid name for a variable

My_name

myName

1Name

My Name

@MyName

Answer explanation

Media Image

A variable can't have spaces between the words and numbers or symbols at the start.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which code will not generate an error?

Firstname = input()

print("Hello,",firstname)

firstname = input()

print("Hello," firstname)

firstname = input()

print("Hello," ,firstname)

firstname = input ()

print("Hello, firstname")

Answer explanation

Media Image

This code is using concatenation!

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which code will print "h"?

planet = "Earth"

print(planet[5])

planet = "Earth"

print(planet[4])

planet = "Earth"

print(planet,[4])

planet = "Earth"

print(planet,[5])

Answer explanation

Media Image

Python codes always start counting at 0!

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will this code print out? number = "5" + "10"

print(number)

15

5 10

510

An error

Answer explanation

Media Image

This code is a string and it will only print out 5 and 10 like 510. If you wanted it to be 15 then you wouldn't put the " ".

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which data type...

Holds alphanumeric data as texts

String

Float

Integer

Boolean

Answer explanation

Media Image

It's a string!

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Strings are represented in code as....

str

int

float

Answer explanation

Media Image

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?