CLASS: SYBSC CS A & B
SUBJECT: Python Programming Language –I
(Mathematics Practical Task)
Instructions of students:
Do all questions in one python file.
Keep save in your folder.
1. Use Python code to evaluate each of the following
expression.a. 20 modulus 2 + 7 - (3 +7) × 20 ÷ 2
b. 30 × 10 floor division 3 + 10 modulus 3
c. 25 - 24 + 4 floor division 4
2. Write Python code to repeat the following string 9 times using the string
operator‘*’.
a. Python
b. Mathematics
3. Write Python program to generate the square of numbers from 1 to 10.
4
4. Write Python code to calculate the volume of a sphere with radius 3r = 7 (V =
πr3).
5. Use Python code to construct string operation ‘+’ below string.
• string1 = Hello, string2 = World!
• string1 = Good, string2 = Morning
6. Write Python code to generate the square of numbers from 20 to 30.
7. Use python code find value of f (−2), f (0), f (2) where f (x) = x2–5x + 6.
8. Write Python program to find the 10 term of the sequence of function
f (x) = x3+5x.
9. Write python code to test whether given number is divisible by 2 or 3 or 5.
10. Repeat the following string 11 times using the string operator ‘*’ on
Python.
• LATEX
• MATLAB
11. Use Python code to find sum of first thirty natural numbers.
12. Using Python construct the following matrices.
1. An identity matrix of order 10 × 10.
2. Zero matrix of order 7 × 3.
3. Ones matrix of order 5 × 4.
13. Generate all the prime numbers between 1 to 100 using Python code.
14. Using python code sort the tuple in ascending and descending order
5, -3, 0, 1, 6,-6, 2.
15. 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]
• Find List1 + List2
• Find 9*List1
• Find 7*List2
16. Write Python code to find the square of odd numbers from 1 to 20 using
while loop.
17. Using Python construct the following matrices.
1. An identity matrix of order 10 × 10.
2. Zero matrix of order 7 × 3.
3. Ones matrix of order 5 × 4.
18. Find the data type of the following data by using Python code.
a. number
b. 31.25
c. 8 + 4j
d. Mathematics
e. 49
19. Write Python program to find all positive prime numbers less then given
number n.
20. Evaluate following expression on Python.
• M = [1,2,3,4], Find length M.
• L= “XYZ” + “pqr”, Find L.
• s= ‘Make In India’, Find (s[:7]) & (s[:9]).