BFC505 - Python
BFC505 - Python
BFC505 - Python
1. What is the data type? List out the types of data types with example
2. Differentiate between C++ and Python
3. Explain in detail about Control flow structures in python
4. Explain break and continue statement with the help of for loop with an example
5. Illustrate the use of input and output statements with the necessary syntax and write
example program
6. Differentiate global and local variables
7. Explain about the import statement in modules
8. Write short note on variable scope and lifetime
9. Explain briefly constant, variables, expression, keywords and statements available in
python
10. Explain how to create a dictionary in python?
11. Write a few methods that are used in Python Lists
12. What is indexing and negative indexing in Tuple?
13. Explain what is dictionary and how it is created in Python?
14. Explain the purpose of loop structure in a programming language Describe the syntax
and semantics of any two loop structures provided by Python
15. With the necessary examples describe the use of continue and break statement
16. Write code snippets in Python to perform the accessing elements of a tuple, modifying
elements of a tuple, and deleting elements of a tuple
17. Explain input function with the help of an example
18. What is Sequence in Python? Explain its operations with suitable examples
19. What is the purpose of else clause for a loop? Explain how else works with while and for
loops, with examples
20. List Explain various types of errors with an example
21. Differentiate between Top down and Bottom up approach
22. Explain a) Documentation b) Structured programming
23. List and explain elements of python
24. List and explain different tools used in program design with example
25. Explain structure of Python program with example
26. What is an algorithm? Explain characteristics of an algorithm
27. What are the features and applications of Python?
28. Explain about the input and output statements or methods with example
29. What is Indentation? Explain with example
30. What is data type? List out the types of data types with example
31. Describe an algorithm for the following
32. i) prime number or not ii) Odd or even
33. Define Flowchart and explain symbols used in flowchart with example
34. Enumerate the list and its methods with example
35. What is dictionary? Explain the methods available in dictionary
36. Differentiate between the tuple and sets in python
37. Define Variable and mention rules for choosing names of Variable
38. Implement the python program to calculate total and average marks based on input
44. Explain break and continue statement with the help of for loop with an example
45. Explain the syntax of the following statements
a. for loop
b. while loop
c. if-else
d. if-elif-else
46. Explain expressions in python with order of evaluation with example
47. Illustrate the use of input and output statements with the necessary syntax and write
example programs
48. Simulate the difference between nested for and for loop Python
49. Explain about different types of control structure?
50. What are membership operators? Give examples for usage
51. Define function? Write its syntax
52. Write functions to do all arithmetic operations
53. Explain lambda function
54. Write recursive function to find factorial of a number
55. Differentiate global and local variables
56. Explain about the import statement in modules
57. Write short note on variable scope and lifetime
58. What is tuple ? What is the difference between list and tuple?
59. Explain briefly constant, variables, expression, keywords and statements available in
python
60. What is len function and explain how it is used on strings with an example
61. Explain how to create a dictionary in python?
62. Write a few methods that are used in Python Lists
63. What is indexing and negative indexing in Tuple?
64. Explain what a dictionary is and how it is created in Python?
65. Explain the purpose of loop structure in a programming language Describe the syntax
and semantics of any two loop structures provided by Python
66. With the necessary examples describe the use of continue and break statements
67. Write code snippets in Python to perform the accessing elements of a tuple, modifying
elements of a tuple, and deleting elements of a tuple
68. Give a comparison between lists, tuples, dictionaries and sets
69. Explain input function with the help of an example
70. What is Sequence in Python? Explain its operations with suitable examples
71. What is the purpose of the else clause for a loop? Explain how else works with while and
for loops, with examples
72. Explain different steps of problem solving techniques
73. Explain the tools which are used to design a program
74. Write a note on algorithms with examples
75. Write advantages and disadvantages of flowchart
76. Create a flowchart to find the largest number among 3 numbers
77. Write a flowchart to find the factorial of a number
78. Write a note on the decision table with an example Write advantages and disadvantages
79. Explain pseudo code with examples
80. Define debugging? Explain Types of error in python with examples
81. Explain debugging techniques in python
82. Write a note on documentation?
83. Explain two classes of documentation?
84. Write different categories of process documentation?
85. Explain structured programming?
86. Write advantages and disadvantages of structured programming
87. Define programming methodology?
88. Explain different types of programming methodologies?
89. Explain top down and bottom up approach?
90. Write advantages and disadvantages of top down and bottom up approach?
91. Explain the structure of python with examples
92. Define function? Explain syntax of function definition
93. Write a note on program statements in python
94. What is a return statement , explain with an example
95. What are multi line statements in python, explain with examples
96. Explain python compound statements with examples
97. Explain 4 components of python
98. Explain elements of python
99. Write a note on the python interpreter
100. What is the difference between a python compiler and interpreter
101. How python is used as a calculator explains
102. Explain python shell
103. Define Atoms Explain with examples
104. Explain identifiers with examples
105. Define keywords
106. Define variables Write the characteristics of variables in python
107. Explain different data types available in python
108. Define Literals Explain different Literals in python
109. Explain relational operators with examples
110. Define assignment operators?
111. Explain different assignment operators present in python
112. Explain ternary operators with examples
113. Define bitwise operators Explain different types with examples
114. Explain python increment/decrement operators with examples
115. Write a note on Input/Output statements in python
116. Explain three types of control statements with suitable examples
117. Write a short note conditional control structure with an example
118. Explain two types of looping control structure of python
119. Write a note on break and continue statements in python
120. Why Pass statement is used in python program, explain with example
121. What is the use of default arguments in function definitions? Explain with
examples
122. Explain basic array operations with examples
123. Explain different string methods with examples
124. What are the strings in python? How we declare strings in python
125. Explain array concatenations with examples
126. How we create python , explain with examples
a) 85.0
b) 85.1
c) 95.0
d) 95.1
147. What will be the output of the following Python code snippet if x=1?
x<<2
a) 8
b) 1
c) 2
d) 4
148. What will be the output of the following Python expression if x=15 and y=12?
x&y
a) b1101
b) 0b1101
c) 12
d) 1101
149. The one’s complement of 110010101 is:
a) 001101010
b) 110010101
c) 001101011
d) 110010100
150. What will be the output of the following Python code?
x = "abcdef" while i in x:
print(i, end=" ")
a) a b c d e f
b) abcdef
c) i i i i i i …
d) error
151.Which of the following commands will create a list?
a) list1 = list()
b) list1 = []
c) list1 = list([1, 2, 3])
d) all of the mentioned
152. Suppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)?
a) 5
b)4
c)None
d)Error
153. Suppose list1 is [3, 5, 25, 1, 3], what is min(list1)?
a) 3
b) 5
c) 25
d) 1
154. To add a new element to a list we use which command?
a) list1.add(5)
b) list1.append(5)
c) list1.addLast(5)
d) list1.addEnd(5)
155. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}
156. Why is a flowchart required?
a). To plan a program before making it.
b). To execute a program.
c). It is easy to use.
d). To analyze the program.
157. Terminal symbol in a flowchart indicates
a) End
b) Input and Output
c) processing
d) Decision
158. Structured Programming is
a) Dividing the program into different program modules
b) Using Structures in the program
c) Using classes in the program
d) None of the above
159. Pseudocode is used for
a) Denoting the program Flow
b) For coding the program
c) To make structure chart
d) To write program steps
160. Indentation in a program
a) Improves its readability and understanding
b) Is Compulsory
c) Both
d) None of the above
161. Method which uses a list of well defined instructions to complete a task starting from a
given initial state from a given initial state to end state is calls as
a) Program
b) Flowchart
c) Algorithm
d) A & B
162. Which of the following is a program planning tool?
a) Sequential
b) Decision
c) Pseudocode
d) Both b and c
163. Which of the following symbol in a flowchart are used to indicate all arithmetic processes
of adding, subtracting, multiplying and dividing ?
a) Input/output
b) terminal
c) Processing
d) Decision
164. Which of the following is a pictorial representation of an algorithm?
a) Pseudo code
b) Program
c) Flowchart
d) Algorithm
165. Pseudo code emphasizes on
a) Development
b) Coding
c) Design
d) Debugging
166. Which of the following program planning tool allows the programmers to plan program
logic by writing program instruction in an ordinary language?
a) Flowchart
b) Pseudo code
c) Program
d) Looping
167. A decision table is
a. a truth table
b. a table which facilitates taking decisions
c. a table listing conditions and actions to be taken based on the testing of conditions
d. a table in a Decision Support System
168. A decision tree does not include:
a) statements
b) condition stubs
c) action stubs
d) rules
169. The part of a decision table that links conditions to actions is the section that contains the:
a) action statements
b) rules
c) condition statements
d) decision stubs
170. Python function always returns a value
a) False
b) True
171. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned
172. If return statement is not used inside the function, the function will return:
A. None
B. 0
C. Null
D. Arbitary value
173. What is a recursive function?
A. A function that calls other function.
B. A function which calls itself.
C. Both A and B
D. None of the above
174. Which operator is used in Python to import modules from packages?
A. .
B. *
C. ->
D. &
175. Lambda is a function in python?
A. True
B. False
C. Lambda is a function in python but user can not use it.
D. None of the above
176. Which one of the following is the correct way of calling a function?
A. function_name()
B. call function_name()
C. ret function_name()
D. function function_name()
177. Which one of the following is incorrect?
A. The variables used inside function are called local variables.
B. The local variables of a particular function can be used inside other functions, but these
cannot be used in global space
C. The variables used outside function are called global variables
D. In order to change the value of the global variable inside the function, keyword global is
used.
178. Which of the following would NOT work as a variable name?
A. a
B. len
C. length
D. x
179. Which is the correct operator for power(xy)?
a) X^y
b) X**y
c) X^^y
d) None of the mentioned
180. What is the output of this expression, 3*1**3?
a) 27
b) 9
c) 3
d) 1