MTC-233 Python Programing Language I Slips Semester III
MTC-233 Python Programing Language I Slips Semester III
x 0 1 2 5
Y=f(x) 5 13 22 129
1. Write Python code to calculate the volume of a sphere with radius r = 7 (V = 34 πr3 ).
1. Use python code find value of f (−2), f (0), f (2) where f (x) = x2 –5x + 6.
2. Write Python program to find the 10 term of the sequence of function f (x) = x3 +5x.
2 2 4
2. Write Python program to evaluate interpolate value f (3.5) of the given data by
Lagranges method.
x 0 1 2 5
Y=f(x) 2 3 12 147
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
2. Repeat the following string 11 times using the string operator ‘*’ on Python.
a. LATEX
b. MATLAB
2. Using python, find the eigenvalues and corresponding eigenvectors of the matrix
" #
3 −2
.
6 −4
3. Generate all the prime numbers between 1 to 100 using Python code.
Q.3. a. Attempt any one of the following. [7]
Rπ
1. Write Python program to estimate the value of the integral 0 sin(x)dx using Simp-
son’s ( 31 )rd rule (n=6).
2. Write Python program to evaluate third order forward difference of the given data.
x 0 1 2 3
Y=f(x) 1 0 1 10
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
x 1 2 3 4 5
Y=f(x) 30 50 55 40 11
R 10 1
2. Write Python program to estimate the value of the integral 2 (1+x)
dx using Trape-
zoidal rule (n=5).
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
1. Using python code sort the tuple in ascending and descending order 5, -3, 0, 1, 6,
-6, 2.
2. Write python program which deals with concatenation and repetition of lists.
List1 = [15, 20, 25, 30, 35, 40]
List2 = [7, 14, 21, 28, 35, 42]
3. Write Python code to find the square of odd numbers from 1 to 20 using while loop.
2. Find the data type of the following data by using Python code.
a. number
b. 31.25
c. 8 + 4j
d. Mathematics
e. 49
1 0 5 " #
2 5
A = 2 1 6 and B =
.
−1 4
3 4 0
1. Write Python program to find all positive prime numbers less then given number n.
2. Write Python program to evaluate f(2.5) by forward difference formula of the given
data.
x 0 1 2 3
Y=f(x) 2 1 2 10
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
1. Using sympy module of python find the following for the matrices
−1 1 0 9 0 3
A = 8 5 2 and B = 1 4 1
.
2 −6 2 1 0 −1
(a) 2A + B.
(b) 3A – 5B.
(c) A−1 .
(d) B 3 .
(e) AT + B T .
3. Use Python code to generate the square root of numbers from 21 to 49.
2. Using linsolve command in python, solve the following system of linear equations.
x − 2y + 3z = 7
2x + y + z = 4
−3x + 2y − 2z = −10
3. Generate all relatively prime numbers to 111 which are less than 150 using Python
code.
1. Write Python code to find eigenvalues and corresponding eigenvectors of the matrix
1 3 3
A = 2 2 3
4 2 1
2. Write Python program to evaluate f(3.5) by forward difference formula of the given
data.
x 1 2 3 4 5
Y=f(x) 41 62 65 50 17
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
a. 23 modulus 2 + 9 - (3 +7) × 10 ÷ 2
b. 35 × 10 floor division 3 + 15 modulus 3
c. 35 − 25 + 4 floor division 7
2. Write Python code to list name and roll number of 5 students in B.Sc.
(Computer science).
3. Write Python code to find maximum and minimum element in the given list.
[7, 8, 71, 32, 49, −5, 7, 7, 0, 1, 6]
1. Using Python code construct identity matrix of order 10 and hence find determinant,
trace and transpose of it.
2. Write Python code to find the value of function f (x, y) = x2 − 2xy + 4 at the points
(2,0) (1,-1).
3. Find number between 1 to 200 which are divisible by 7 using Python code.
" #
3 −2
A=
6 −4
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
a. z1 + z2
b. z1 − z2
c. z1 ∗ z2
2. Repeat the following string 7 times using the string operator ‘*’ on Python.
a. Complex Number
b. Real Number
1. Using Python code construct 0nes matrix of order 10 × 10 and hence find determi-
nant, trace and transpose of it.
3. Generate all the prime numbers between 500 to 1000 using Python program.
2. Write Python program to evaluate interpolate value f (3) of the given data.
x 0 1 2 5
Y=f(x) 2 3 12 147
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
2. Write Python program to evaluate f(2.8) using backward difference formula of the
given data.
x 0 1 2 3
Y=f(x) 1 0 1 10
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
3. Write Python code to find area and circumference of circle with radius 14.
1. Using Python code logically verify associativity of matrices with respective to matrix
addition (use proper matrices).
3. Using Python code, find determinant and inverse of the matrix if exist.
4 2 2
A = 2 4 2
2 2 4
2. Write Python program to evaluate fourth order forward difference of the given data.
x 1 2 3 4 5
Y=f(x) 41 62 65 50 17
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
a. 30 modulus 2 + 7 - (3 +9) × 20 ÷ 5
b. 30 × 10 floor division 3 + 30 modulus 3
c. 55 - 53 + 7 floor division 7
(a) sin30
(b) pi
(c) e
(d) cos30
2. "Using python
# find the eigenvalues and corresponding eigenvectors of the matrix
3 −2
.
6 −4
3. Write Python code to verify (AB)−1 = B −1 A−1 (Use proper matrices A and B).
Q.3. a. Attempt any one of the following. [7]
R 10
1. Write Python program to estimate the value of the integral 1 (x2 + 5x)dx using
Simpson’s ( 13 )rd rule (n=5).
2. Write Python program to evaluate interpolate value f (2.5) of the given data.
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
x 1 2 3 4
Y=f(x) 1 8 27 64
2. Write Python program to evaluate fourth order forward difference of the given data.
x 1 2 3 4 5
Y=f(x) 40 60 65 50 18
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
3. Write Python code to find area of triangle whose base is 10 and height is 15.
2. Write Python program to find the value of function f (x) = x2 + x, (−5 ≤ x ≤ 5).
2. Write Python program to evaluate interpolated value f (2.7) of the given data
f(2)=0.69315,f(2.5)=0.91629,f(3)=1.09861.
0 0 1
2. Use linsolve command in python to solve the following system of linear equations.
x − 2y + 3z = 7
2x + y + z = 4
−3x + 2y − 2z = −10
3. Generate all the prime numbers between 51 to 100 using Python program.
Q.3. a. Attempt any one of the following. [7]
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
R 10 x
1. Write Python program to estimate the value of the integral 0 e dx using Simpson’s
( 38 )th rule(Take h = 0.5).
2. Write Python program find the approximate root of the function x5 + 3x + 1, in [-2,
0] using Newton Raphson Method correct upto 4 decimal places.
2. Write Python program to evaluate interpolate value f (153) of the given data.
a. 23 modulus 2 + 9 - (3 +7) × 10 ÷ 2
b. 35 × 10 floor division 3 + 15 modulus 3
c. 35 - 25 + 4 floor division 7
2. Use while command on Python to find odd positive integer between 25 to 50.
1 0 5 4
3. For matrix A = 2 1 6 −1 apply the following operations by using python.
3 4 0 2
4 2 1
2. Write Python program to find the product of n natural numbers using while loop.
" #
3 −2
6 −4
a. z1 + z2
b. z1 − z2
c. z1 ∗ z2
2. Use Python code to find area and circumference of square whose length is 5.
2. Write Python program to evaluate interpolate value f (5.5) of the given data.
x 3 5 7 9
Y=f(x) 5 7 27 64
x 1 2 3 4 5
Y=f(x) 40 60 65 50 18
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
(a) print(a+c)
(b) print(a*b)
(c) print(c**d)
(d) print(a/b)
(e) Expression: 3 + ( 9 - 2) / 7 * 2 ** 2
3. Using sympy module of python find the eigenvalues and corresponding eigenvectors
of the matrix
4 2 2
A = 2 4 2 .
2 2 4
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
x 1 2 3 4 5
Y=f(x) 30 50 65 40 18
.
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
(a) sin75
(b) pi/2
(c) e
(d) cos56
3. Write Python program to find diameter, area, circumference of the circle with radius
is 5.
1. Using Python code construct any three matrices A,B and C to show that
(A+B)+C=A+(B+C).
2. Using python find the eigenvalues and corresponding eigenvectors of the matrix
" #
3 −2
.
6 −4
3. Generate all prime numbers between 1000 to 2000 using Python program.
2. Write Python program to evaluate interpolate value f(2.2) of the given data
f(2)=0.593,f(2.5)=0.816,f(3)=1.078.
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
1. Using Python code, find percentage of marks 70,80, 55, 78, 65 in five subject out of
100 each.
2. Using sympy module of python, find the following terms of vector x = [1, -5, 0] and
y = [2, 3, -1].
a. 5x
b. x+y
c. x-3y
Rπ
1. Write Python program to estimate the value of the integral 0 sin(x)dx using Simp-
son’s ( 13 )rd rule (n=6).
1. Write the Python code to print ‘Python is bad’ and ‘Python is wonderful’ , where
wonderful is global variable and bad is local variable.
2. Write Python code to evaluate eigen value and eigen vector of the following matrix.
1 1 1
A = 0 1 1
0 0 1
1. Using Python code construct any two matrices A and B to show that
(AB)−1 = B −1 A−1 .
2. Use linsolve code in python to solve the following system of linear equations.
x − 2y + 3z = 7
2x + y + z = 4
−3x + 2y − 2z = −10
1 3 3
3. Write python code to find trace and transpose of the matrix 2 2 3
4 2 1
1. Write Python program to find f(3) of the functional value f(1)=2, f(2)=10, f(4)=68
by using Lagrange method.
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
1. Use Python code to find minimum value from the given numbers
16,3,5,48,2,4,5,6,78,12,5,6,24.
2. Use Python code to find hypotenuse of triangle whose sides are 12 and 5.
3. Use Python code to remove all digits after decimal of the given Number 125312.3142.
(a) A+B
(b) AT
(c) A−1
2. Use while code on Python to find sum of first twenty natural number.
" #
3 −2
6 −4
2. Write Python program to evaluate interpolate value f (2.9) of the given data.
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
x 1 2 3 4
Y=f(x) 11 9 27 64
3. Write Python code to list name and birth date of 5 students in your class.
2 2 1
2 0 −1 11
4 2 0 −1
R1 1
1. Write Python program to estimate the value of the integral 0 1+x2 dx by using
Simpson’s ( 38 )th rule (n=6).
2. Write python program to find sin(42)0 using Newton backward interpolation for-
mula for the data:
sin300 = 0.5, sin350 = 0.5736, sin400 = 0.6428, sin450 = 0.7071.
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
1. Write Python code to print first n natural numbers and their square roots of input
integer n.
2. Use Python code to find sum of square of first twenty five natural numbers.
1. Write python code to display tuple ‘I am Indian ’ and the second letter in this tuple
2. Write python code to display the matrix whose all entries are 10 and order is (4,6).
" #
3 −2
6 −4
2. Write Python program to evaluate interpolate value f (5) of the given data.
x 1 2 3 6
Y=f(x) 2 6 12 42
2. Write Python code to list name and birth date of 5 students in your class.
(4a+b)
3. Write Python function f (a, b) = 3(a–6b)
, find the value of f (12, 25).
2. Write python code to perform the R2 + 2R1 row operation on given matrix.
1 1 1
R = 2 2 2
3 3 3
3. Write python code to find all the eigen values and the eigen vectors of the matrix.
2 −1 −1 0
−1 3 −1 −1
−1 −1 3 −1
−1 −1 −1 2
2. Write a Python program to evaluate interpolate value f (3) of the given data.
x 1 2 3 4
Y=f(x) 11 22 33 66
2. Write Python program to find sin(37)0 using Newton backward interpolation for-
mula for the data:
sin300 = 0.5, sin350 = 0.5736, sin400 = 0.6428, sin450 = 0.7071.
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
1. Write Python code to sort a tuples in ascending order (49, 17, 23, 54, 36, 72).
2. Find the values of the following expressions if x and y are true and z is false.
(a) (x or y) and z.
(b) (x and y) or not z.
(c) (x and not y) or (x and z).
1. Write Python program that prints whether the given number is positive, negative
or zero.
1 −3 2 −4
−3 9 −1 5
A=
5 −2 6 −3
−4 12 2 7
Find the Null space, Column space and rank of the matrix.
2. Write Python program to evaluate interpolate value f (2) of the given data.
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
x 11 12 13 14
Y=f(x) 21 19 27 64
1 0 8
Find the transpose of the matrix, determinant, inverse of the matrix. Also reduce
the matrix to reduced row echelon form and diagonalize it.
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
2. Write Python code to prints all integers between 1 to 100 that are divisible by 3
and 7.
3. Write Python code to prints all integers between 1 to n, which are relatively prime
to n.
Q.2. Attempt any two of the following. [10]
1. Write Python code to find determinant, transpose and inverse of matrix.
1 2 3
A = 2 5 7
4 9 11
2. Write Python program to find the roots of the quadratic equation ax2 + bx + c = 0.
3x − 7y − 2z = −7
−3x + 5y + z = 5
6x − 4y = 2
2. Write Python program to find sin(35)0 using Newton backward interpolation for-
mula for the data:
sin300 = 0.5, sin350 = 0.5736, sin400 = 0.6428, sin450 = 0.7071.
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
2. Use Python code to find the remainder after dividing by ‘n’ to any integers.
3. Write Python program to prints all integers between 1 to 50 that are divisible by 3
and 7.
2. Write Python program to prints whether the given natural number is divisible by 5
and less than 100.
" #
2 −3
4 −6
x 1 2 3 4
Y=f(x) 11 10 15 10
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
2. Write Python program to evaluate interpolate value f (17) of the given data.
x 12 22 32 62
Y=f(x) 25 65 125 425
MTC-233 Python Programming Language-I Savitribai Phule Pune University, Pune
1. Write Python program to print the integers between 1 and 1000 which are multiples
of 7.
1. Write Python program to find the area and circumference of a circle with radius r.
2. Use Python code to solve the following system of equations by gauss elimination
method
x + y + 2z = 7
−x − 2y + 3z = 6
3x − 7y + 6z = 1
3. Write Python code to find eigen values, eigen vectors of the matrix and determine
whether the matrix is diagonalizable.
1 −1 1
A = −1 1 −1
1 −1 1
1. Write Python program to find the approximate root of the equation f (x) = x2 − 50
by using Newton Raphson method.
2. Write Python program to evaluate f(2.4) by forward difference formula of the given
data.
x 0 1 2 3
Y=f(x) 11 10 11 21
2. Write Python program to find f(4) using Lagranges interpolation formula from the
data: f (1) = 6, f (2) = 9, f (5) = 30, f (7) = 54.