1. Each question below gives multiple choices of answers. Choose the most appropriate one. (1×10)
1.1 The following symbol represent :
(a) Decision
(b) Initialization
(c) Input/Output
(d) None of Mentioned
1.2 When an algorithm is written in the form of a programming language, it become a :
(a) Flowchart
(b) Program
(c) Pseudo code
(d) Syntax
1.3 Which of the following is not a keyword in python ?
(a) eval
(b) assert
(c) nonlocal
(d) pass
1.4 Which one of the following has the highest precedence in the expression?
(a) Exponential
(b) Addition
(c) Multiplication
(d) Parentheses
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 Java.
(c) Both of the above.
(d) None of the above
1.6 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) PYTHONSTARTUP
(d) PYTHONSTARTUP
1.7 Which of the following type is not support in python ?
(a) Numbers
(b) String
(c) List
(d) Slice
1.8 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.9 Select the reserved keyword in python :
(a) else
(b) raise
(c) import
(d) All of the mentioned
1.10 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.
2) State which of the following is True or False:- 1×10=10
No. | Questins | T/F |
2.1 | The external style sheet may be written in any text editor but must be saved with a .css extension. | 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 be performed on a string. | F |
2.5 | Addition and subtractions has the same precedence level. | T |
2.6 | The expression int(x) implies that the variable x is converted to integer. | T |
2.7 | values () is a function of dictionary gets all the values from the dictionary. | T |
2.8 | nested if-else are allowed in Python. | T |
2.9 | unichr(x) function convert an integer to octal string in python. | F |
2.10 | frozenset(s) function convert a sequence of tuple to dictionary in python | F |
3) Match the following:- 1×10=10
No. | X | Y |
3.1 | filter() (D) | A. It takes iterables (can be zero or more), makes iterator that aggregates elements based on the iterrables passed, and returns an iterator of tuples. |
3.2 | 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. Constructs an iterator from elements of an iterable for which a function returns true. |
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. Start and end of a flow chart. |
3.8 | getcwd() (M) | H. Creates a slice object representing the set of indices specified by range (start, stop, step). |
3.9 | 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 specification instructions that solve a problem with an end or a solution. | ||
L. Method returns truth if all characters in the string are alphanumeric (either alphabets or numbers). If not, it returns false. | ||
M. Method display the current working directory. |
4) Fill in the blanks:- 1×10=10
A) help() | B) ft.shutdown() | C) flow chart |
D) fp.close() | E) tell() | F) unpickling |
G) uppertolower() | H) Swapcase | I) readline() |
J) alias | K) seek | I) scanoneline() |
M) arrange |
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 sequence of numbers, NumPy provides a function __M___ Analogous to range that returns array insist of list.
4.4 _E_ return the current file position after reading the first line.
4.5 __F__ is method sets the file’s current position at the offset.
4.6 __G___ 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.