[go: up one dir, main page]

0% found this document useful (0 votes)
25 views4 pages

CTP Mid2 Bit Bank

Uploaded by

mohanqwe903
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views4 pages

CTP Mid2 Bit Bank

Uploaded by

mohanqwe903
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Marks

VISHNU INSTITUTE OF TECHNOLOGY (AUTONOMOUS)


VISHNUPUR: BHIMAVARAM
Mid-II Examinations
Computational Thinking & Programming

BRANCH : IT DATE:
YAR/SEM : TIME:

Name of the Student: __________________________ Hall Ticket Number: __________________

Answer all of the following .Each carries ½ Marks. Max. Marks: 10


1. List is a data structure and is a collection of _______ elements [ ]
a) Mutable b) Immutable c) Unordered d) Same type

2. used to find the length of the tuple.


a) Tuple.length() b) len(tuple) c) Size(tuple) d) tuple.size() [ ]

3. SumofElements() is a _______ function in Python [ ]


a)User-Defined b) Pre-defined
c) Base d) None of the above

4. Which keyword is used to declare a function in python [ ]


a)fun() b) def() c) init() d) dec_fun()

5. Anonymous function is also called as_____function [ ]


a)Beta Function b) Lambda c) Global d) None of the above

6. Which is used for writing data over-writing everytime [ ]


a)write 2)append 3)read 4)execute

7. Return the current file pointer ? [ ]


a) Seek() b) tell() c) offset() d) observer()
8. Which mode is used to read text data from a file [ ]
a) wb b) r c) rb d) read

9. Spreadsheets are a type of ____________files [ ]


a) RTF files b) txtfiles c) CSV files d) All of these

10. Pickling is a way to convert a ______into a character stream.?


a) Python Objects b) Python functions c) Python Methods d)Attributes [ ]

11. Which is used to close a file [ ]


a. Filename.close b) filename.exit c) filename.clear d) all of these
12. ____method is used to unpickle the data
a. load b) dump c) pickled d) getdata [ ]

13. Which of these can be used to return the directory name [ ]


a. OS.getpwd() b)Os.path.dirname() c) OS.path() d)OS.getwd()

14. Which of the following executes source code line by line? [ ]


a. Compiler b) Interpreter c) Assembler d) none of these

15. The concept of OOP in Python focuses on creating


a)Unusable Code b) Re usable code
c) Static code d) OPCode [ ]

16. Which of the following errors is generated when rules of a programming language
are violated? [ ]
a) Syntax errors b) Semantic Errors c) Linker Errors d) Logical Errors

17. Which is used to handle exceptions in Python [ ]


a) Try-Handle b) Try-Catch
c) Try-Except d) Try-Clear

18. The default constructor is simple constructor which doesn’t accept any [ ]
a) Values b) Arguments
c) Data d) Declarations

19. The word polymorphism means having? [ ]


a) Same Forms b) Different Form c) Unique Form d) Inherent Form

20. Which operator Is used to concatenate string type data [ ]


a) - b) % c) + d) *
21) In dictionaries, data is stored in which format [ ]
a) Number format b) Key, Value Pairs c) Sorted format d) Unsorted

22) Which of the following functions is a built-in function in python? [ ]


a) factorial() b) print() c) seed() d) sqrt()

23) What will be the output of the following Python function?


len(["hello",2, 4, 6]) [ ]
a) Error b) 6 c) 4 d) 3

24) list, tuple, and range are the ___ of Data Types. [ ]
A)Sequence Types B) Binary Types C) Boolean Types D) None of the above

25) bytes, bytearray, memoryview are type of the ___ data type. [ ]
A) Mapping Type B) Boolean Type C) Binary Types D)None of the above

26) What is the name of the operator ** in Python? [ ]


A) Exponentiation B) Modulus C) Floor division D) None of the above

27) Amongst which of the following is / are the method of list? [ ]


A) append() B) extend() C) insert() D) All of the mentioned above

28) Python Dictionary is used to store the data in a ___ format. [ ]


A) Key value pair B) Group value pair C) Select value pair D) None of the above

29) Conditional statements are also known as ___ statements. [ ]


A) Decision-making B) Array C) List D) None of the mentioned above

30) In Python, ___ defines a block of statements. [ ]


A) Block B) Loop C) Indentation D) None of the mentioned above

31) In Python, the break and continue statements, together are called ___ statement.
A) Jump B) goto C) compound D) None of the mentioned above

32) Amongst which of the following is / are the key functions used for
file handling in Python? [ ]
A) open() and close() B) read() and write() C) append() D) All of the mentioned above

33) The function file_object.close() is used to ___. [ ]


A) To open the existing file B) To append in an opened file
C) To close an opened file D) None of the mentioned above
34) The seek() method is used to ___. [ ]
A) Saves the file in secondary storage B) Position the file object at a particular position in a file
C) Deletes the file form secondary storage D)None of the mentioned above

35) The module Pickle is used to ___. [ ]


A) Serializing Python object structure B) De-serializing Python object structure
C) Both A and B D) None of the mentioned above

36) Amongst which of the following is / are the method used to unpickling data from a binary
file? [ ]
A) load() B) set() method C) dump() method D) None of the mentioned above

37) The word polymorphism means having? [ ]


a) Same Forms b) Different Form c) Unique Form d) Inherent Form

38) Which mode is used too read text data from a file [ ]
a) wb b) r c) rb d) read

39) What is the extension of Python Program? [ ]


A. .execute python B. .python C. .py D. .run python

40) Which is Identifier in Python? [ ]


A. 3yz B. $1xy C. @pyth D. _ab4

Signature of the Faculty __________________ ______________________


Invigilator Subject Faculty

You might also like