You are on page 1of 9

E.M.G. YADAVA WOMEN’S COLLEGE, MADURAI – 625 014.

(An Autonomous Institution – Affiliated to Madurai Kamaraj University)

Re-accredited (3rd Cycle) with Grade A+ & CGPA 3.51 by NAAC

DEPARTMENT OF COMPUTER SCIENCE (Data Science and Analytics)

Title of the paper : PYTHON PROGRAMMING


Semester :I
Sub Code :
Class : I Bsc CS (DS)

ONE MARK QUESTIONS AND ANSWERS


Choose the correct answer:
1. Python was developed by _________. (K2)

a. Guido van Rossum b. James Gosling


c. Dennis Ritchie d. Bjarne Stroustrup

Ans:(a) Guido van Rossum

2.____________is a software containing a interpreter that converts the byte code


into machine code in python. (K2)

a. Python Virtual Machine (PVM) b. Syntax Checker


c. Translator d. Byte code
Ans:(a) Python Virtual Machine (PVM)

3.Which is the default compiler for python Language? (K1)

a.CPython b.PyPy c.IronPython d.Jython

Ans:(a) CPython

4. _________ is not a keyword in python language. (K2)


a.Pass b.eval c.assert d.nonlocal

Ans:(b) eval

5.What is used to define a block of code in Python? (K1)

a.Parenthesis b. Indentation c. Curly braces d. Square bracket

Ans:(b) Indentation

6._________ character is used to represent the single line comment .(K2)

a. * b. @ c. # d. !

Ans:(c) #

7.Python compiler translates the python program into an intermediate code called
__________ . (K2)

a.Byte code b.object oriented code c.Functional code d.logical code

Ans:(a) Byte code

8. which compiler is used to speed up the execution of the python program? (K1)

a.Just In time b.Run time c.Logical time d.Common run time

Ans:(a) Just In time

9.Which operator is used for floor division? (K1)

a.// b./ c.% d. |

Ans:(a) //

10 . What does NumPy stand for? (K1)


a. Numerical Python b. Natural Python
c. Numeric Program d. Nonlinear Python
Ans:(a) Numerical Python

11. A statement inside ‘if’ has indentation of ____________ space. (K2)

a. Two b. Four c.Six d. eight

Ans:(b) Four

12.____________ keyword is not in the jump statement. (K2)

a. For b. pass c. Continue d. Break

Ans:(a) For

13. Which of the following loop is work on the particular range in


python ?(K1)
a. while loop b. for loop
c. do while loop d. Nested loop

Ans:(b) for loop

14. Python allows the else keyword to be used with the for and while loops
is called ____________. (K2)

a. while loop b. for loop


c. do while loop d. else suit in loop

Ans:(d) else suit in loop

15. What does break statement do? (K1)

a. Stop b. Repeat c. Skip d. Print

Ans:(a) Stop

16.The Condition in loop is checked based on the value of a variable called


the______________ . (K2)
a.loop’s special variable b.loop’s control variable
c.loop’s execution variable d. loop’s defined variable

Ans:(b) loop’s control variable

17. Python executes one statement to another statement from starting to


end, this is known as ____________. (K2)

a. Selection construct b. Sequential Construct


c. Iteration Construct d. Conditional Construct

Ans:(b) Sequential Construct

18. What does continue statement do? (K1)

a. Print b. Stop c. Skip d. Repeat

Ans:(c) Skip

19.Which statement is generally used as placeholder? (K1)

a. Continue b. break c. Pass d. goto

Ans:(c) Pass

20. Which statement is encountered, the control jumps to the


beginning of the loop for the next iteration? (K1)

a. Break b. Continue c. Exit d. pass

Ans:(b) Continue

21.Functions defined by the users themselves is called____________ . (K2)


a. built-in Functions b. user-defined Functions
c. Recursion Functions d. Lambda Functions

Ans : (b) user-defined Functions

22. Which arguments will invoke the function after the parameters are recognized
by their parameter names? (K1)

a. Required arguments b. Keyword arguments


c. Default arguments d. Variable-length arguments

Ans : (b) Keyword arguments

23.Which of the following is the slicing operator? (K1)

a. {} b. [ ] c. < > d. ( )
Ans : (b) [ ]

24.The ____________ is the part of memory the system stores the parameter and
local variables of function call. (K2)

a. heap b. stack c. Uninitialized data segment d. Queue


Ans : (b) stack

25. Stride is called ____________ .(K2)

a. Index value of slide operation b. first argument of slice operation

c. second argument of slice operation d.third argument of slice operation

Ans : (d) third argument of slice operation

26.What is a variable defined outside a function referred to as? (K1)

a. local variable b. global variable


c. static Variable d. automatic variable

Ans : (b) global variable

27.How is a function declared in Python? (K1)


a. def function function_name(): b. declare function function_name():
c. def function_name(): d. declare function_name():

Ans : (c) def function_name():

28. A ___________ function can take any number of arguments but have only one
expression. (K2)

a. built-in b. user-defined
c. Recursion d. Lambda

Ans : (d) Lambda

29. The ___________ arguments the correct positional order is passed to


a function.(K2)

a. Required b. Keyword
c. Default d. Variable-length

Ans : (a) Required

30. Which function is used to find length of string? (K1)

a. length() b. len() c. strlen() d.slen()

Ans : (b) len()

31.Write the output of the following code.(K2)


list(“welcome”)

a.[ ‘w’, ‘e’, ‘l’, ‘c’, ‘o’, ‘m’, ‘e’] b.[‘ welcome’]
c.(“welcome”) d.(‘welcome’)

Ans : (a) [ ‘w’, ‘e’, ‘l’, ‘c’, ‘o’, ‘m’, ‘e’]

32. Tuples are_____________. (K2)


a. Mutable b. Immutable c. Mutable to some extent d.Immutable to all

Ans : (b) Immutable

33. The tuples values are enclosed in___________ . (K2)

a. Square brackets b. Curly brackets c. Parenthesis d. angle brackets

Ans : (c) Parenthesis

34.Which of the following is not a function of tuple? (K1)

a.update() b. min() c. max() d.count()

Ans : (a) update()

35.Which function will get the size of the python tuple? (K1)

a.size() b. len() c. lenln() d.list_len()

Ans : (b) len()

36. _________ are used to store the values in keys and pairs. (K2)

a.Set b.Map c.Dictionary c.Tuple

Ans : (c) Dictionary

37.Which method is used to remove the entire dictionary? (K1)

a.pop() b.delete() c.delete_all() d.clear()

Ans : (d) clear()

38. __________method is an alternative method to remove the particular item from


Python. (K2)
a.pop() b.delete() c.delete_all() d.clear()

Ans : (a) pop()

39.What function is used to modify the key or value in a dictionary? (K1)


a.modify() b.update() c.change() d.new()

Ans : (b) update()

40.Which keyword is used to check the particular key in the dictionary? (K1)

a.Is b.in c. check if d. not

Ans : (b) in

41.The __________function is used to write a list of string in a file. (K2)

a. writeline() b. writelines() c. writestatement() d. writefullline()

Ans :(a) writeline()

42.A _________ file is just a file that contains information in the same format in
which the information is held in memory. (K2)

a. Text file b. Binary file c. Word file d. Py file

Ans :(b) Binary file

43.Which command is used for opening a file in Python file handling ? (K1)

a. open() b. update() c. Close() d. edit()

Ans : (a) open()

44.________ command is used for closing a file in Python file handling. (K2)

a. close() b. closing() c. object() d. update()


Ans : (a) close()

45.Which method is used to sets the position of a file pointer? (K1)


a. tell() b. fseek() c. seek() d. ftell()

Ans : (c) seek()

46.Which method reads one complete line from a file? (K1)

a. Read( ) b. Readline() c. Readlines() d. Traverse()

Ans : (b) Readline()

47.________ function is used to write the file contents of buffer on to storage.(K2)

a. flush() b. push() c. clear() d. None of the above

Ans : (a) flush()

48.Which of the following removes the given character from trailing end or from
the right end? (K1)

a. strip() b. rstrip() c. lstrip() d. tstrip()

Ans : (b) rstrip()

49. The __________ are the files that store data pertaining to a specific
application. (K2)

a. Files b. data files c. dump file d. Text file

Ans : (b) data files

50. How the parent directory is denoted? (K1)

a. Three dots (…) b. Two dots (..) c. colon(:) d. comma (,)


Ans : (b) Two dots(..)

You might also like