Python Syntax Quiz

Python Syntax Quiz

1st Grade

20 Qs

quiz-placeholder

Similar activities

BAB 3 : KOD ARAHAN ( 2 AMANAH)

BAB 3 : KOD ARAHAN ( 2 AMANAH)

1st - 5th Grade

20 Qs

Python: nivel 2

Python: nivel 2

1st Grade

15 Qs

ASK F2 -KOD ARAHAN (PYTHON)

ASK F2 -KOD ARAHAN (PYTHON)

1st Grade - University

15 Qs

quiz dasar python

quiz dasar python

1st Grade - University

20 Qs

Python_Nhập xuất_If else

Python_Nhập xuất_If else

1st - 5th Grade

20 Qs

Python Series

Python Series

1st - 5th Grade

15 Qs

Python Pages 10 to 26

Python Pages 10 to 26

1st - 5th Grade

15 Qs

Python Syntax Quiz

Python Syntax Quiz

Assessment

Quiz

Computers

1st Grade

Medium

Created by

Adham Elmuntser

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for an if statement in Python?

if x = 5

if x == 5

if x := 5

if x != 5

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you check if two variables are equal in Python?

x == y

x = y

x != y

x < y

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? x = 5 if x > 3: print("Hello") else: print("Goodbye")

Hello

Goodbye

Error

None of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to combine multiple conditions in an if statement?

and

or

not

xor

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of x after the following code? x = 10 x += 5

10

15

5

20

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to check if a variable is in a list?

if x contains [1, 2, 3]

if x in [1, 2, 3]

if x includes [1, 2, 3]

if x has [1, 2, 3]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? x = 7 y = 3 print(x % y)

2

3

1

0

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?