
Python Programming Quiz
Authored by Sankarsan Sahoo
Engineering
University
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the primary purpose of the decimal module in Python?
To perform faster arithmetic operations than standard floats.
To handle financial calculations and ensure exact decimal representations.
To convert numbers between different bases (binary, octal, hexadecimal).
To provide advanced mathematical functions like trigonometry and logarithms.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code? from decimal import Decimal print(Decimal('0.3') + Decimal('0.2') == Decimal('0.6'))
True
False
Error
Machine dependent
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To represent the fraction 3/4 accurately in Python, which of the following is the most appropriate?
0.75
3 / 4
fractions.Fraction(3, 4)
decimal.Decimal('0.75')
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of fractions.Fraction(1, 3) + fractions.Fraction(1, 6)?
fractions.Fraction(1, 2)
fractions.Fraction(2, 9)
0.5
fractions.Fraction(3, 18)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an incorrect way to create a Decimal object from a floating-point number in a way that might introduce precision issues?
Decimal(0.1)
Decimal('0.1')
Decimal(str(0.1))
None of these
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of Decimal('1.200').normalize()?
Decimal('1.200')
Decimal('1.2')
Decimal('1.20')
Decimal('1.2e+0')
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid way to create a Money object?
my_money = Money(10, "USD")
my_money = Money("10", "USD")
my_money = Money(10 USD)
my_money = Money(amount=10, currency="USD")
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
15 questions
Web3 and Blockchain Challenge
Quiz
•
University
10 questions
COA-Introduction-Assessment
Quiz
•
University
15 questions
TECH WHIZ
Quiz
•
University
15 questions
Dioda
Quiz
•
11th Grade - University
14 questions
NLP Quizz Unit-3
Quiz
•
University
11 questions
Equilibrium & Truss
Quiz
•
University
15 questions
Digital Electronics Quiz -U1-U2
Quiz
•
University
15 questions
RoboRover
Quiz
•
University
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade
Discover more resources for Engineering
8 questions
2 Step Word Problems
Quiz
•
KG - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
10 questions
14.2 Independent/Dependent Variables
Quiz
•
KG - University
18 questions
Great Lakes States
Quiz
•
KG - University
7 questions
DNA, Chromosomes, Genes, and Traits: An Intro to Heredity
Interactive video
•
11th Grade - University
7 questions
Reflexive Verbs in Spanish
Lesson
•
9th Grade - University
7 questions
Narrative Writing 1
Interactive video
•
4th Grade - University