Python Modulus & Exponent & If 305

Python Modulus & Exponent & If 305

9th - 12th Grade

17 Qs

quiz-placeholder

Similar activities

Python Casting and Input

Python Casting and Input

8th - 11th Grade

15 Qs

Foundations of Programming

Foundations of Programming

9th - 10th Grade

18 Qs

Python Revision

Python Revision

7th - 9th Grade

14 Qs

Python (Selection)

Python (Selection)

8th - 10th Grade

13 Qs

Procedures and Functions

Procedures and Functions

10th Grade

20 Qs

Python Basics - Year 8

Python Basics - Year 8

7th - 9th Grade

14 Qs

Revision

Revision

9th Grade

17 Qs

Unit 3 Python TEST

Unit 3 Python TEST

11th - 12th Grade

20 Qs

Python Modulus & Exponent & If 305

Python Modulus & Exponent & If 305

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Mr Minyard

Used 4+ times

FREE Resource

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the modulus operator (%) in Python do?

Divides two numbers and returns the quotient

Divides two numbers and returns the remainder

Multiplies two numbers

Subtracts one number from another

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

(Python) If `x = 5` and `y = 2`, what is the result of `x % y`?

2.5

2

1

0

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the exponent operator (**) in Python do?

Raises the first number to the power of the second number

Multiplies the first number by the second number

Divides the first number by the second number

Adds the first number to the second number

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If `x = 3` and `y = 4`, what is the result of `x ** y`?

12

81

64

7

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct basic if statement in Python?

if x = 5:

if x == 5

if x == 5:

if x = 5

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will the following Python code output?

x = 10

if x > 5:

print("Greater")

else:

print("Smaller")

Smaller

Greater

Error

Nothing

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Python, how do you assign an integer value of 20 to a variable named `age`?

age == 20

age = 20

int age = 20

age := 20

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?