Revision Test- Programming in Python
Quiz
•
Computers
•
University
•
Hard
Chhinder Kaur
FREE Resource
Enhance your content in a minute
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.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
13 questions
Five Nights At Freddy's: Security Breach Quiz
Quiz
•
KG - Professional Dev...
20 questions
Fintech
Quiz
•
University
15 questions
Firewall and Network Security
Quiz
•
University
10 questions
Information systems concepts
Quiz
•
University
18 questions
PBO Inheritance Episode 2
Quiz
•
University
13 questions
L1 - Computer Networks
Quiz
•
University
15 questions
DBC CHAPTER 3 - REVISION
Quiz
•
University
10 questions
Algorithm analysis: divide & conquer theory
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
