# SymPy MCQ Questions & Answers

SymPy MCQs : This section focuses on "SymPy" of Python library. These Multiple Choice Questions (MCQ) should be practiced to improve the SymPy skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.

1. ___________ is a Python library for performing symbolic computation.

A. SciPy

B. SymPy

C. Seaborn

D. rxpy

View Answer

Ans : B

Explanation: SymPy is a Python library for performing symbolic computation.

2. First version of SymPy published in?

A. 2005

B. 2006

C. 2007

D. 2008

View Answer

Ans : C

Explanation: A team of developers led by Ondřej Čertík and Aaron Meurer published first version of SymPy in 2007. Its current version is 1.5.1.

3. The output for the below code snippet is :

import math
print (math.sqrt(25), math.sqrt(7))

A. 4.0 2.6457513110645907

B. 5.0 3.6457513110645907

C. 5.0 1.6457513110645907

D. 5.0 2.6457513110645907

View Answer

Ans : D

Explanation: Output : 5.0 2.6457513110645907

4. How many subclasses number class has?

A. 1

B. 2

C. 3

D. 4

View Answer

Ans : B

Explanation: The core module in SymPy package contains Number class which represents atomic numbers. This class has two subclasses: Float and Rational class.

5. The output for the below code snippet is :

from sympy import Float
Float(1.33333,2)

A. 1

B. 1.3

C. 1.33

D. 1.4

View Answer

Ans : C

Explanation: The output for the below code snippet is as follows : 1.3

6. SymPy has a RealNumber class that acts as alias for Float.

A. TRUE

B. FALSE

C. Can be true or false

D. Can not say

View Answer

Ans : A

Explanation: True, SymPy has a RealNumber class that acts as alias for Float.

7. Which number in SymPy defines as singleton classes?

A. 0

B. 1

C. -1

D. Both A and B

View Answer

Ans : D

Explanation: SymPy has a RealNumber class that acts as alias for Float. SymPy also defines Zero and One as singleton classes accessible with S.Zero and S.One

8. ________ function is used to convert any arbitrary expression such that it can be used as a SymPy expression.

A. evalf()

B. sympify()

C. lambdify()

D. None of the above

View Answer

Ans : B

Explanation: The sympify() function is used to convert any arbitrary expression such that it can be used as a SymPy expression.

9. evalf() function evaluates a given numerical expression upto a given floating point precision upto ______ digits.

A. 1

B. 10

C. 100

D. 1000

View Answer

Ans : C

Explanation: This function evaluates a given numerical expression upto a given floating point precision upto 100 digits. The function also takes subs parameter a dictionary object of numerical values for symbols

10. Symbol is the most important class in symPy library.

A. Yes

B. No

C. Can be yes or no

D. Can not say

View Answer

Ans : A

Explanation: Symbol is the most important class in symPy library. Symbolic computations are done with symbols. SymPy variables are objects of Symbols class.

Discussion