PYQ – PYTHON PROGRAMMING (2418305) | SEMESTER 3RD (2ND YEAR) | Year 2023

Python Programming 2023 OLD PYQ.
Choose the most suitable answer from the following options: - (1*20=20)
(i) In which year was the python language developed?
(a) 1995
(b) 1972
(c) 1981
(d) 1989
(ii) In which language is python written?
(a) English
(b) PHP
(c) C
(d) All of the above
(iii) What do we use to define a block of code in python language?
(a) Key
(b) Brackets
(c) Indentation
(d) None of these
(iv) Which character is used in python to make a single line comment?
(a) /
(b) //
(c) #
(d) !
(v) What is the method inside the class in python language?
(a) Object
(b) Function
(c) Attribute
(d) Argument
(vi) Which of the following declarations is incorrect?
(a) - x = 2
(b) - - x = 3
(c) - - xyz -- = 5
(d) None of these
(vii) What is the extension of python file?
(a) .py
(b) .python
(c) .p
(d) None of these
(viii) Which of the following is not a keyword in python languages.
(a) Val
(b) raise
(c) try
(d) with
(ix) Which of the following words cannot be a variable in python programming
language?
(a) -val
(b) val
(c) try
(d) -try-
(x) Which of the following operators is the correct option for power (ab0?
(a) a ^ b
(b) a ** b
(c) a ^^ b
(d) a ^* b
(xi) Which one of the following has the highest precedence in the expression?
(a) Division
(b) Subtraction
(c) Power
(d) Parentheses
(xii) Which of the following functions is a built-in python language?
(a) Val ()
(b) print ()
(c) printf ()
(d) None of these
(xiii) Which of the following is correctly evaluated for this function? Pow (x,y,z)
(a) (x ** y) /z
(b) (x/y) * z
(c) (x ** y) % z
(d) (x/y)/z
(xiv) What will be the output of this statement >>> “a” + “bc”
(a) a + bc
(b) abc
(c) a b c
(d) a
(xv) All keywords in python are in
(a) Capitalized
(b) Lower case
(c) Upper case
(d) None of the mentioned
(xvi) Which of the following character is used to give single-line comments in
python?
(a) //
(b) #
(c) !
(d) /*
(xvii) Which of the following functions helps us to find the version of python that
we are currently working on?
(a) sys.version (1)
(b) sys.version (0)
(c) sys.version ()
(d) sys.version
(xviii) What will be the output of the following python function?
Len ([“hello”,2,3,4])
(a) Error
(b) 6
(c) 4
(d) 3
(xix) What will be the output of the following python code snipped?
for i in [1,2,3,4] [::-1]:
print (i)
(a) 4 3 2 1
(b) error
(c) 1 2 3 4
(d) None
(xx) Which one of the following is not a keyword in python language?
(a) pass
(b) eval
(c) asset
(d) nonlocal
Group:-"B"
➥ Answer all Five Questions: - (5*4=20)
2. Discuss python and its history.
OR
Discuss the process of declaration of variables in python.
3. Discuss python name spaces.
OR
Discuss the use of help () and dict () functions in python.
4. Diffrerntitate between list and tuples in python.
OR
Discuss the advantages of python.
5. Define slicing in python with the help of example.
OR
Discuss keywords in python.
6. Differentiate between local and global variable in python.
OR
Discuss read function in python.
Group:- "C"
➥ Answer all Five Questions: - (5*6=30)
7. Define function in python with the help of code.
OR
Discuss conditional statement in python detail.
8. Write a program in python to find out the maximum number in a given python list.
OR
Differentiate between loop and while loop.
9. Write a python program to swap two numbers using function.
OR
Discuss different string operations with help of examples in python.
10. Discuss the common built-in data types in python.
OR
Write a python program to print factorial of a number.
11. Write notes of the followings:
Module
Write function in python
OR
Write notes on following:
Web2py
regex
*****
PYQ Video References
No references available right now.
Comments & Reviews
Loading comments...
