Python Programming Quiz: If-Else Statements

Python Programming Quiz: If-Else Statements

6th Grade

5 Qs

quiz-placeholder

Similar activities

9.03 Programming Iteration

9.03 Programming Iteration

5th - 10th Grade

10 Qs

Python Basic

Python Basic

6th - 8th Grade

10 Qs

VEXcode VR Unit 9

VEXcode VR Unit 9

6th Grade

10 Qs

Coding Conditionals

Coding Conditionals

6th - 8th Grade

10 Qs

Programming - Iteration, Basic Programming Constructs & Loop

Programming - Iteration, Basic Programming Constructs & Loop

2nd - 12th Grade

10 Qs

Coding Conditionals

Coding Conditionals

6th - 8th Grade

10 Qs

Loops & Conditional Blocks in Scratch

Loops & Conditional Blocks in Scratch

6th - 12th Grade

10 Qs

Python

Python

1st - 12th Grade

10 Qs

Python Programming Quiz: If-Else Statements

Python Programming Quiz: If-Else Statements

Assessment

Quiz

Computers

6th Grade

Easy

Created by

22.Kritika Agrawal

Used 3+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 10 pts

What is the syntax of the if statement in Python?

if (condition) then {

if (condition) {

if (condition) do:

if condition:

2.

MULTIPLE CHOICE QUESTION

45 sec • 10 pts

What is the syntax of the else statement in Python?

else;

else()

else{}

else:

3.

MULTIPLE CHOICE QUESTION

45 sec • 10 pts

What are the conditional operators used in if-else statements in Python?

+, -, *, /

==, !=, >, <, >=, <=

and, or, not

&&, ||, !

4.

MULTIPLE CHOICE QUESTION

45 sec • 10 pts

What are some common mistakes students make when using if-else statements in Python?

Forgetting to use a colon after the if or else statement, or forgetting to indent the code within the if or else block.

Using a semicolon after the if or else statement

Forgetting to use parentheses after the if or else statement

Indenting the code within the if or else block

5.

MULTIPLE CHOICE QUESTION

45 sec • 10 pts

Explain why do we use if-else statements in Python programming?

To print output to the console

To make decisions based on certain conditions

To create loops in the program

To perform mathematical calculations