Search Header Logo

Python Part 1

Authored by Thomas Reynolds

Computers

8th Grade

Python Part 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What does the print("Hello") command do?

Displays the text "Hello" on the screen
Stores the text "Hello" in a variable
Takes input from the user
Adds a comment to the code

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the purpose of # in Python?

To add a comment that the computer ignores
To create a variable
To start a function
To repeat code

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following is a valid way to create a variable with a string?

name = "Alice"
"Alice" = name
name == "Alice"
input(name = "Alice")

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the correct way to ask a user for their name?

name = input("What is your name?")
name = print("What is your name?")
input("What is your name?") = name
name == input("What is your name?")

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What does this f-string do? print(f"Hello, {name}!")

Combines the word "Hello" with the value of name
Declares a new variable
Asks for input from the user
Adds a comment

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the correct way to convert input into an integer?

age = int(input("Enter your age: "))
int = input("Enter your age")
input(int("Enter your age: "))
age = input(int("Enter your age: "))

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following data types can hold decimal numbers?

float
int
str
bool

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?