Revision Test- Programming in Python

Revision Test- Programming in Python

University

15 Qs

quiz-placeholder

Similar activities

Python Basics

Python Basics

University

10 Qs

XI Assessemnt 2

XI Assessemnt 2

11th Grade - University

10 Qs

python test 1_23_24

python test 1_23_24

University

10 Qs

UNIT1-PYTHON

UNIT1-PYTHON

University

20 Qs

Technical Quiz R1

Technical Quiz R1

University

20 Qs

Python Quiz - BPLCK105B

Python Quiz - BPLCK105B

University

20 Qs

Python Basics

Python Basics

University

10 Qs

Q2 - Python

Q2 - Python

University

10 Qs

Revision Test- Programming in Python

Revision Test- Programming in Python

Assessment

Quiz

Computers

University

Hard

Created by

Chhinder Kaur

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Who developed Python Programming Language?

Wick van Rossum

Rasmus Lerdorf

Guido van Rossum

Niene Stom

Answer explanation

Python language is designed by a Dutch programmer Guido van Rossum in the Netherlands.

2.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which of the following is the correct extension of the Python file?

.python

.pl

.py

.p

Answer explanation

‘.py’ is the correct extension of the Python file. Python programs can be written in any text editor. To save these programs we need to save in files with file extension ‘.py’.

3.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which of the following is used to define a block of code in Python language?

Indentation

Key

Brackets

All of the mentioned

Answer explanation

In Python, to define a block of code we use indentation. Indentation refers to whitespaces at the beginning of the line.

4.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which of the following character is used to give single-line comments in Python?

//

#

!

/*

Answer explanation

To write single-line comments in Python use the Numero sign (#) at the beginning of the line. To write multi-line comments, close the text between triple quotes.

5.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What is the order of precedence in python?

Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

Exponential, Parentheses, Division, Multiplication, Addition, Subtraction

Parentheses, Exponential, Multiplication, Division, Subtraction, Addition

Parentheses, Exponential, Multiplication, Division, Addition, Subtraction

Answer explanation

For order of precedence, just remember this PEMDAS (similar to BODMAS).

6.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which of the following is not a core data type in Python programming?

Tuples

Lists

Class

Dictionary

Answer explanation

Class is a user-defined data type.

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What will be the output of the following Python expression if x=56.236? print("%.2f"%x)

56.236

56.23

56.0000

56.24

Answer explanation

The expression shown above rounds off the given number to the number of decimal places specified. Since the expression given specifies rounding off to two decimal places, the output of this expression will be 56.24. Had the value been x=56.234 (last digit being any number less than 5), the output would have been 56.23.

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?