Introduction to Python

Introduction to Python

University

15 Qs

quiz-placeholder

Similar activities

Python Basics

Python Basics

University

15 Qs

Python For And While Loop

Python For And While Loop

9th Grade - University

20 Qs

SOAL MODUL 4 : Pemahaman Looping dan Kondisional

SOAL MODUL 4 : Pemahaman Looping dan Kondisional

10th Grade - University

10 Qs

Quiz # 2- Computer Pogramming 2

Quiz # 2- Computer Pogramming 2

University

20 Qs

PP-ASSESSMENT-1

PP-ASSESSMENT-1

University

20 Qs

AWD - Prelim Quiz

AWD - Prelim Quiz

University

20 Qs

C-Py QUIZ | ROUND 1

C-Py QUIZ | ROUND 1

University

20 Qs

/Python_Quiz\

/Python_Quiz\

KG - Professional Development

20 Qs

Introduction to Python

Introduction to Python

Assessment

Quiz

Computers

University

Medium

Created by

Lakshmi.D Lakshmi

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code: print(5 > 3 and 2 < 4)?

2 > 4

True

False

5 < 3

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the difference between 'if', 'if-else', and 'if-elif-else' statements in Python.

'if' checks a condition, 'if-else' provides an alternative for false conditions, and 'if-elif-else' allows multiple conditions to be evaluated.

'if' is for checking types, 'if-else' is for importing modules, and 'if-elif-else' is for defining classes.

'if' and 'if-else' are the same, while 'if-elif-else' is a deprecated feature.

'if' is used for loops, 'if-else' is for defining functions, and 'if-elif-else' is for error handling.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of this code: x = 10; if x < 5: print('Low'); else: print('High')?

High

Low

Undefined

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'break' statement in a loop?

To continue the loop indefinitely.

To exit a loop prematurely.

To skip the current iteration of the loop.

To pause the loop for a specified time.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Describe the use of the 'continue' statement in a loop.

The 'continue' statement skips the current iteration of a loop and continues with the next iteration.

The 'continue' statement repeats the current iteration of the loop.

The 'continue' statement pauses the loop for a specified time.

The 'continue' statement terminates the loop immediately.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a Boolean value in Python? Give an example.

True and False are the two Boolean values in Python.

On and Off

Yes and No

True and Maybe

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code output: for i in range(3): print(i)?

1, 2, 3

0, 1, 2

0 1 2

-1, 0, 1

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?