M3-R5 Python Programming Question Paper with Answer

M3-R5 Python Programming Question Paper with Answer

M3-R5 Programming and Problem Solving through Python
(September 2021)

Q.1. Each question below gives a multiple choice of answers.
1.1 Which one of the following has the highest precedence in the expression?
निम्नलिखित अभिव्यक्ति में किसका उच्चतम प्रिसीडेंस है?
(A) Exponential चरघातांकी ✔️
(B) Addition योग
(C) Multiplication गुणन
(D) Parentheses लघु कोप्टक ✔️

1.2 Which statement is correct? कौन सा कथन सही है?
(A) List is mutable & Tuple is immutable. ✔️
(B) List is immutable & Tuple is mutable.
(C) Both List and Tuple are Mutable.
(D) Both List and Tuple are Immutable.

1.3 Which of the following is the correct extension of the Python file?
निम्न में से कौन पायथन फाइल का सही एक्सटेंशन है?
(A) .python
(B) .py ✔️
(C) .pl
(D) .p

1.4 Which of the following is not a keyword in Python?
पायथन में निम्नलिखित में से कौन सा एक कीवर्ड नहीं है?
(A) eval ✔️
(B) assert
(C) nonlocal
(D) pass

1.5 Which of the following is correct about Python?
पायथन के बारे में निम्नलिखित में से कौन सा सही है?
(A) It supports automatic garbage collection.
(B) It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Lava.
(C) Both of the above. ✔️
(D) None of the above.

1.6 When an algorithm is written in the form of a programming language, it becomes a:
जव एक एल्गोरिथ्म एक प्रोग्रामिंग भाषा के रूप में लिखा जाता है, तो यह एक बन जाता है।
(A) Flowchart
(B) Program ✔️
(C) Pseudo code
(D) Syntax

1.7 Which of the following environment variable for Python tells the Python interpreter where to locate the module files imported into a program?
पायथन के लिए निम्नलिखित में से कौन सा एनवायरनमेंट वेरिएबल पायथन इंटरप्रेटर को यह बताता है, कि एक प्रोग्राम में इम्पोर्ट की गई मॉड्यूल फ़ाइलों को कहाँ स्थापित करना है?
(A) PYTHONPATH ✔️
(B) PYTHONSTARTUP
(C) PYTHONCASEOK
(D) PYTHONHOME

1.8 Select the reserved keyword in python:
पाइथन में आरक्षित कीवर्ड का चयन करें?
(A) else
(B) raise
(C) import
(D) All of the mentioned ✔️

1.9 Which of the following function of dictionary gets all the keys from the dictionary?
निम्नलिखित में से डिक्शनरी का कौन सा फंक्शन सभी कुंजीयाँ डिक्शनरी से प्राप्त करता है?
(A) getkeys()
(B) key()
(C) keys()✔️
(D) None of the Mentioned

1.10 Which of the following data types is not supported in python?
पाइथन में निम्नलिखित में से कौन सा डेटा प्रकार सपोर्ट नहीं किया जाता है?
(A) Numbers
(B) String
(C) List
(D) Slice ✔️

Q.2. Each statement below is either TRUE or FALSE.

No. Question T/F
2.1 In Computer Science, algorithm refers to a special method usable by a computer for the solution to a problem.  कंप्यूटर विज्ञान में, एल्गोरिथ्य एक समस्या के समाधान के लिए कंप्यूटर द्वारा प्रयोग करने योग्य एक विशेष विधि को संदर्भित करता है। T
2.2 Any algorithm is a program. कोई भी एल्गोरिथ्म एक प्रोग्राम है। F
2.3 Python is case sensitive when dealing with identifiers. आइडेंटिफाइयर के साथ व्यवहार करते समय पाइथन केस सेंसीटिव है। T
2.4 Mathematical operations can performed on a string. गणितीय परिचालन एक स्ट्रिंग पर किये जा सकते हैं। F
2.5 Addition and Subtraction has the same precedence level. जोड़ने और घटाने का एक ही पूर्वता स्तर है।जोड़ने और घटाने का एक ही पूर्वता स्तर है। T
2.6 The expression int(x) implies that the variable x is converted to integer. एक्सप्रेशन int(x) का अर्थ है कि वेरिएबल x पूर्णांक में बदल जाता है। T
2.7 values() is a function of dictionary gets all the values from the dictionary. values () डिक्शनरी का एक फंक्शन है जो डिक्शनरी से सभी वैल्यूज प्राप्त करता है। T
2.8 nested if-else are allowed in Python. पाइथन में नेस्टेड if-else को अनुमति दी जाती है। T
2.9 unichr(x)function convert an integer to octal string in python. पाइथन में urichr(x) फंक्शन एक पूर्णांक को ऑक्टल स्ट्रिंग में परिवर्तित करता है। F
2.10 frozenset(s) function convert a sequence of tuples to dictionary in python. पाइथन में frozenset(s) फंक्शन टुपल्स के एक अनुक्रम को डिक्शनरी में परिवर्तित करता है। F

Q.3. Match words and phrases in column X with the closest related meaning of word(s)/phrase(s) in column Y.

  X   Y
3.1 filter()  (D) A. It take iterables (can be zero or more), makes iterator that aggregates elements based on the iterables passed, and returns an iterator of tuples.
3.2 None of these  (G) B. A function converts a string to a list in python.
3.3 strip() (F) C. Flow chart symbol that is used for processing of data or calculations.
3.4 Isalnum() (L) D. Who developed the Python language?
3.5 list()  (B) E. used in flow chart for input and output of data
3.6 Algorithm (K) F. in-built function of Python is used to remove all the leading and trailing spaces from a string.
3.7 bin()  (J) G. What is the maximum possible length of an identifier?
3.8 getcwd()  (M) H. Creates a slice object representing the set of indices specified by range (start, stop, step).
3.9 Guido van Rossum               (D) I. Method converts a value to Boolean (true or false) using the standard truth testing procedure.
3.10 Zip()  (A) J. Converts and returns the binary equivalent string of a given integer.
    K. An explicit set of step by step specific instructions that solve a problem with an end or a solution.
    L. Method returns true if all characters in the string are alphanumeric (either alphabets or numbers). If not, it returns false.
    M. Method displays the current working directory

Q.4. Each statement below has a blank space to fit one of the word(s) or phrase(s) in the list below

Ahelp()Bfpshutdown()Cflow chart
Dfpclose()Etell()Funpickling
Guppertolower()Hswapcase()Ireadline()
JaliasKseekLscanonline()
Marrange    

4.1 A graphical representation of a computer program in relation to its sequence of functions…C
4.2 …A…method calls the built-in Python help system.
4.3 To create sequences of numbers, NumPy provides a function…M…analogous to range that returns arrays instead of lists.
4.4 …E…_return the current file position after reading the first line.
4.5 …K… is a method sets the file’s current position at the offset.
4.6 …F…_is used for object deserialization.
4.7 …H…_method converts all uppercase characters to lowercase and vice versa of the given string, and returns it.
4.8 ndarray is also known as the…J…array.
4.9 …D… is used to close a file object (fp).
4.10 …I…reads one entire line from the file.

PART TWO
Answer any FOUR questions

5.
(A) What do you mean by an Algorithm? What are the characteristics of an Algorithm? Write an Algorithm to find the factorial of given integer number.
एल्गोरिथ्म का क्या अर्थ है? एक एल्गोरिथ्य की विशेषताएँ क्या हैं? दी गई पूर्णांक संख्या के भाज्य को खोजने के लिए एक एल्गोरिथ्म लिखें।
(B) What do you mean by decision? Making statements in python? Explain nested if statements with suitable example.
पाइथन में डिसिजन मेकिंग स्टेटमेंट्स का क्या अर्थ है? नेस्टेड इफ स्टेटमेंट्स की उपयुक्त उदाहरण के साथ व्याख्या करें।

6.
(A) What is list and tuple in python? Give the differences between list and tuple.
पाइथन में लिस्ट आर टपल क्या हैलिन और टपल के बीच अंतर लिखें।
(B) Why Python programming language is becoming so popular in programming world? List the applications of python and explain any one with suitable example.
प्रोग्रामिंग दुनिया में पायथन प्रोग्रामिंग लैंग्वेज इतनी लोकप्रिय क्यों हो रही है? पाइथन के एप्लीकेशनों के नाम बताएँ और किसी एक की उपयुक्त उदाहरण के साथ व्याख्या करें।

7.
(A)Explain numPy library in python. Write a numPy program to generate five random numbers from the normal distribution.
पाइथन में numPy लाइबेरी की व्याख्या करें। सामान्य वितरण से पांच यादृच्छिक संख्याएँ उत्पन्न करने के लिए एक numly प्रोग्राम लिखें।
(B) Explain the following:
(i) broadcasting in numPy
(ii) islower)
(iii) reado
(iv) dictionary in python
(v) indentation in python

8.
(A) Define recursive function. Write a recursive function to convert decimal number to binary number.
रिकर्सिव फंक्शन की परिभाषा लिखें। दशमलव संख्या को बाइनरी में बदलने के लिए एक रिकर्सिव फंक्शन लिखें।
(B) How to create a string in Python? List and explain the operations which can on strings.
पायथन’ में एक स्ट्रिंग कैसे बनाते है? उन ऑपरेशनों को सूची बद्ध करें और समझाएँ जो स्ट्रिंग पर प्रदर्शन कर सकते हैं।

9.
Attempt any three from the following:
निम्नलिखित में से किन्हीं तीन के बारे में लिखें :
(A) Write a python program to remove multiple elements from a list in Python.
(B) Draw a flowchart to find GCD of two numbers.
(C) Write a Python program to copy odd lines of one file to other.
(D)Explain join(), isspace() with suitable example.