Python variables and operators quiz

Python variables and operators quiz

9th - 12th Grade

20 Qs

quiz-placeholder

Similar activities

WORD

WORD

11th Grade

20 Qs

TIN 12_BÀI 11

TIN 12_BÀI 11

12th Grade

20 Qs

حاسب 1 نظري

حاسب 1 نظري

10th Grade

21 Qs

Latihan Jaringan Dasar PSAS

Latihan Jaringan Dasar PSAS

10th Grade

20 Qs

2561-1-ระบบสื่อสารสำหรับเครือข่ายคอมพิวเตอร์

2561-1-ระบบสื่อสารสำหรับเครือข่ายคอมพิวเตอร์

12th Grade

20 Qs

Text and Image representation

Text and Image representation

11th Grade

22 Qs

PTS TIK Kelas 9 Semester Ganjil

PTS TIK Kelas 9 Semester Ganjil

9th Grade

20 Qs

Operating System

Operating System

12th Grade

17 Qs

Python variables and operators quiz

Python variables and operators quiz

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Medium

Created by

Brett Kottmann

Used 21+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

Which of the following is NOT a valid Python data type?

float

int

str

positive

2.

DRAG AND DROP QUESTION

20 sec • 5 pts

To test whether one number is greater than or equal to another, you would use the ​ (a)   conditional operator.

>=
<=
>
<
=

Answer explanation

Media Image

To combine two operators, just put them next to each other. Thus "greater than or equal to" combines greater than (>) and equal (=): >=

3.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

Which of the following is a valid Python assignment statement?

x = 3

x := 3

x == 3

x <- 3

4.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

What is the correct Python syntax to output the type of a variable?

print(type(x))

print(typeof(x))

print(typeof x)

print(type x)

5.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

How do you insert COMMENTS in Python code?

// this is a comment

/* this is a comment */

# this is a comment

-- this is a comment

6.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

Which of the following is NOT a Python keyword?

for

while

loop

if

Answer explanation

Media Image

7.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

Which of the following will prompt a user for input and assign that input to a variable?

x = input("Please enter your name: ")

x = get(input)

x = prompt("Enter your name: ")

x = "Please enter your name: "

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?