CU SEC-2 Python Programming and LaTeX, 2026
University of Calcutta question paper, B.Sc. Honours Semester II, 2026. Python Programming and LaTeX. Typed in LaTeX, searchable, with a printable PDF.
Open this paper in MathQP
- Write a Python program to find minimum of three number.
- For data =[8,3,6,1,9] , write statements to obtain the last two elements and to replace 6 by 10.
- Write a Python program that accepts the radius of a circle and prints its area and circumference.
- What will be output of the following code? l texttt a = [1, 5, 3, 4] texttt b = [1, 2, 5] texttt print (a>b) texttt print (a+b) texttt print (a[::-1])
- Using SymPy, evaluate the symbolic expression 2x 2+3xy-y 2 for x=1.5 and y=2 .
- Use SymPy to simplify the expression dfrac (x 4-1) (x-1)(x+1) .
- Write the appropriate Python code to extract the following string from s = 'Python and Latex': (i) and Latex (ii) PYTHON AND LATEX (iii) Python.
- Write the output of the following code: l texttt i, j, k = 3, 0, -2 texttt v = i and k texttt w = i or j or k texttt x = i and j and k texttt y = i or j and k texttt z = i and j or k texttt print (v, w, x, y, z)
- Explain with examples the list operations: (i) insert(), (ii) remove(), (iii) reverse().
- Determine the outputs: (i) print('Hi'*3) (ii) print(len('Python')) (iii) print(25//4 + 25%4 + 2**3).
- Write a Python code to compute S= displaystyle sum n=1 30 dfrac 1 u n 2+1 , where u 1=1 , u 2=1 and u n+1 =u n+u n-1 , n ge 2 .
- Write a Python program to generate a list of all integers between 1 and 1000 which are not divisible by 2, 3, 5. Print the list.
- Write a program in Python without inbuilt function to sort the elements of a list in ascending order.
- (i) Write Python codes to solve the following equations using SymPy: x+5y+z=1 and x-3y+2z=3 . (ii) Write the Python code to find a value of x where sin (x)= cos (x) using SymPy.
- Plot the functions f(x)=x 2 and g(x)= exp (x) on the same graph over the interval [-2,2] using a dashed line for f(x) and a dotted line for g(x) . Also, add labels to the axes and a title to the graph.
- Write a Python function that takes two lists and returns True if they have at least one common member and print all common elements.
- What will be the output of the following program? (i) l texttt list1=[[11, 12, 13, 14], [15, 16, 18]] texttt print(list1[1][2]) (ii) l texttt sum, n=0,1 texttt while n<=10: hspace 2.0em texttt sum +=n hspace 2.0em texttt n+=2 texttt print(sum) (iii) l texttt for x in set ('pqr'): hspace 2.0em texttt print(x*2)
- Which package is commonly used for mathematical symbols and colouring of text in a LaTeX document?
- Write LaTeX code to typeset the definite integral: displaystyle int 0 pi sin (x) ,dx=2 .
- Write the LaTeX command to typeset the fraction dfrac a+b c+d and cube root sqrt [3] x+y .
- Mention any one optional argument with its use that can be given in documentclass article command.
- Write the command in LaTeX to write the following equation involving determinant: M 12 = a 21 a 23 a 31 a 33 .
- Write a block of LaTeX code to display the following table: |l|c|c| hline O1 O2 hline X 87 77 hline Y 79 82 hline
- What is the output of the following command: l texttt textdollar textdollar textbackslash prod n=0 textasciicircum textbackslash infty textbackslash left(1+2 textasciicircum -2 textasciicircum n textbackslash right) textdollar textdollar
- Write the LaTeX source code of the following 4 lines: (i) The moment of inertia ( I ), is I= dfrac 12mr 2 . (ii) I am a student of B.Sc. Course. (iii) The angle of the prism is, dfrac pi 3 . (iv) The resistance of a filament, R t=R 0(1+ alpha t+ beta t 2) .
- Write codes in LaTeX to typeset the following: x 2 n=1+ dfrac 12+ left ( dfrac 13+ dfrac 14 right )+ dots + left ( dfrac 1 2 n-1 + dots + dfrac 1 2 n right ) >1+ dfrac 12+ left ( dfrac 14+ dfrac 14 right )+ dots + left ( dfrac 1 2 n + dots + dfrac 1 2 n right ) .
- Write a code in LaTeX to produce the output: f(x)= x 2, 0 le x le 2, -x 2, -2 le x<0, 0, otherwise.
- Write a block of LaTeX code to display: x+y+z=6 , a-b+2c=3 , 2p-q+r=5 (as three aligned equations).
- Write a block of LaTeX code to display the following table: |r|c|c|c| hline Maths Physics Chemistry hline Rian 87 77 93 hline Jamima 79 82 78 hline Rituraj 66 59 71 hline Shrenka 59 77 70 hline