Random Questions
Random Questions
a. Programming
b. problem solving
c. Algorithm
d. Analysis
e. None of the above
Answer: b
6. ________________ is a precise sequence of a limited number of unambiguous executable steps that terminates in the form
of a solution.
a. Algorithm
b. SDLC Models
c. Flowchart
d. Program
e. None of the above
Answer: a
10. ___________ cannot be identified by the compiler at compile time and identified at the execution time.
a. Logical errors
b. Syntax errors
c. Compiler errors
d. Bugs
e. None of the above
Answer: a
34. _____________ refers to the set of rules that defines how human users and the system should write and interpret a python
program.
a. Python Guidelines
b. Python Keywords
c. Python Syntax
d. Python Variables
e. Python Algorithm
Answer: c
35. The following are python keywords except:
a. break
b. def
c. void
d. for
e. continue
Answer: c
36. Which of the following is a valid identifier?
a. @class_mine
b. 5myClass$%
c. print_hello9
d. continue11
e. break
Answer: b
37. __________ are used for storing data values that can be changed.
a. Variable
b. Keyword
c. Names
d. Pseudocode
e. Identifier
Answer: a
38. Variable names can contain the following except
a. Letters
b. Numbers
c. Space
d. Underscore
e. Uppercase letters
Answer: c
39. These are python statements except
a. Variable statement
b. If statement
c. For statement
d. While statement
e. Else statement
Answer: a
40. Variable Names cannot start with _______________
a. Uppercase letter
b. Number
c. Underscore
d. Lowercase letters
e. None of the above
Answer: b
41. The following are numerical datatypes in python except
a. int
b. long
c. float
d. complex
e. Unsigned int
Answer: e
42. Which is an example of float datatype?
a. -786
b. 13.20
c. 0.1222L
d. 3i+26j
e. 56
Answer: b
43. _________ is used to assign a value to a variable.
a. =
b. +
c. -
d. *
e. %
Answer: a
44. What does a break statement do?
a. It is used to exit a loop prematurely.
b. It is used to exit a function
c. It is used to skip the rest of the current iteration of a loop
d. It is used to delete an object from a list
e. It is used to assign a value to a variable
Answer: A
45. _________ are special symbols that performs an operation on one/ more values.
a. Expressions
b. Operands
c. Decision symbols
d. Operators
e. Special characters
Answer: d
46. A sequence of operands and operators is called ____________
a. String
b. Expression
c. Alphanumeric
d. Algorithm
e. Flowchart
Answer: b
47. What will be the output of?
a = 37
b=7
a%b =
a. 7
b. 5
c. 2
d. 1
e. 3
Answer: c
48. ______________ operators are used to perform common mathematical operators.
a. Assignment
b. Comparison
c. Logical
d. Arithmetric
e. Addition
Answer: D
49. num1 = 4
num2 = 5
res = num1 + num2
res += num1
print((“Result of + is”,res))
What will be the output?
a. 10
b. 9
c. 4
d. 14
e. 13
Answer: e
50. ______________ operators compares the values on either side of the operands.
a. Assignment
b. Relational
c. Logical
d. Identity
e. None of the above
Answer: b
51. _____________ logical operator reverses the result
a. Logical NOT
b. Logical AND
c. Logical OR
d. Logical REV
e. None of the above
Answer: a
52.| stands for ____________ , & stands for ______________ and ~ stands for __________
a. OR,NOT,AND
b. NOT,AND,OR
c. OR,AND,NOT
d. AND,OR,NOT
e. NOT,OR,AND
Answer: c
53._____________ control statement allows a program to test several conditions and execute instructions based on which
condition is true.
a. Selection
b. Repetition
c. Loop
d. Sequential
e. Iteration
Answer: a
54. ____________ loops are used to execute a block of statements repeatedly until a given condition is satisfied.
a. Else
b. While
c. If
d. Nested if
e. For
Answer: B
55. ____________ loop is used to iterate over a sequence that is either a list type or a set.
a. While
b. If
c. Ifelif
d. For
e. Ifelse-ifelse
Answer: d
56. Which is correct?
a. If:
else;
b. If:
else
c. If:
else:
d. If;
else:
e. If
else
Answer: c
57. What will be the output?
Age = 27
If Age >= 60:
print(“Senior discount”)
elif 18 <= Age < 60:
print(“No discount”)
else:
print(“Junior Discount”)
a. No discount
b. Senior discount
c. Junior discount
d. Error
e. 27
Answer: A
58. Def for_loop_example()
n=5
for i in range (0,n):
print (i)
What is the output?
a. 0,1,2,3,4,5
b. 0,1,2,3,4
c. 1,2,3,4,5
d. 1,2,3,4
e. Error
Answer: B
59. ___________ statements can be used in for and while loops.
a. If else
b. Else
c. Elif
d. None of the above
e. All of the above
Answer: b
60. In __________ control statement,instructions are executed one after the other.
a. branching
b. Iteration
c. Sequence
d. Selection
e. Loop
Answer: c
61. _______________ statement stops the continuation of the loop while ______________ statement stops only the current
iteration of the loop.
a. Continue,break
b. Stop,repeat
c. While,for
d. Break,continue
e. For,while
Answer: d
62. Which is a branching statement?
a. If else-ifelse
b. Break
c. For
d. Continue
e. Print
Answer: a
63. What is the general format of a for loop?
a. For element in iterable;
body
b. For element in iterable:
body
c. For element in iterable(body)
d. For element in iterable then body
e. None of the above
Answer: b
64. a = 15
If(a<10):
print(“15 is less than 10”)
else:
Print(“Error”)
What is the output of this simple program?
a. 15 is less than 10,error
b. 15 is less than 10
c. 15
d. 10
e. Error
Answer: e
65. Num1 = 1.5
Num2 = 6.3
Sum = float(num1) + float(num2)
Print(“The sum is =”, sum)
Sum_of_two_no():
a. 7.8
b.7.0
c.6.3
d.8.8
e.0.0
Answer: a
66. ________________ is the act of writing computer code to create a program to solve a problem.
a. Debugging
b. Programming
c. Problem solving
d. All of the above
e. None of the above
Answer: b
67. At what stage in SDLC can a project be terminated?
a. Maintenance stage
b. Design stage
c. Implementation stage
d. Feasibility Study stage
e. All stages
Answer: d
68. Fourth generation languages are the following except
a. SQL
b. Applescript
c. Automatic Code script
d. VB script
e. None
Answer: c
69. ______________ uses zeroes and ones only.
a. Machine language
b. Assembly language
c. Scripted language
d. High level language
e. Artificial intelligence
Answer: a
70. _____________ is used to indicate string literals.
a. “ “
b. /
c. {}
d. +;
e. =+
Answer: a
71. ____________ error occurs while a program is running.
a. Syntax
b. Runtime
c. Running
d. Program
e. Compiler
Answer: b
72. In the expression
3 + 6 , 6 stands for _____________
a. Expression
b. String
c. Connector
d. Operand
e. Operator
Answer: d
73. What is the function of % ?
a. Assigns a value to a variable
b. Performs exponent calculations
c. Returns remainder after division
d. Divides two or more values
e. None
Answer: c
74. x = 56 , y = 4 What is x // y?
a. 60
b. 14
c. 52
d. 224
e. 56^4
Answer: b
75. x **= 3 ?
a. 56^3
b. 56*3
c. 56 + 3
d. 56 is not 3
e. None
Answer: a
76. ____________ identity operator returns true if both variables have the same value.
a. Is not
b. It Is
c. Is
d. Or
e. And
Answer: c
77. _______________ returns true if all statements are true and false otherwise.
a. OR
b. AND
c. NOT
d. OR and AND
e. None
Answer: b
78. _______________ returns true if either of the statements is true and false is all statements are false.
a. AND
b. NOT
c. IS
d. OR
e. TRUE
Answer: d
79. ________________ identity operator returns true if both variables does not have the same value.
a. NOT
b. IS NOT
c. IS
d. AND NOT
e. AND
Answer: b
80. Which is a jumping statement?
a. Jump
b. Continue
c. Termination
d. Exit
e. Print
Answer: b
81. _____________ is used to define a block of code in python language.
a. Curly braces
b. Semi colon
c. Round brackets
d. Round braces
e. Indentation
Answer: e
82. A piece of memory that allows the program to process data in it, is called?
a. Constant
b. RAM
c. Var
d. Variable
e. ROM
Answer: d
83. Algorithms can be represented as ____________
a. Flowcharts
b. Pseudocodes
c. Programs
d. Applications
e. All of the above
Answer: e
84. Who developed python language?
a. Zim den
b. Guido Van Rossum
c. Niene Storm
d. Wick Van Rossum
e. Charles Babbage
Answer: b
85. Which one of the following is the correct extension of the python file?
a. Py
b. Python
c. P
d. Phy
e. None
Answer: a
86. Which character is used in python to make a single line comment?
a. /
b. #
c. //
d. %
e. ?
Answer: b
87. What is the output of 4*2**3?
a. 24
b. 32
c. 12
d. 36
e. Error
Answer: b
88. What is the output of “love” + 2+9?
a. Love11
b. error
c. Love29
d. love
Answer: b
89. Python is case- sensitive.
a. True
b. False
Answer: a
90. The default control structure in python is?
a. Selection
b. Repetition
c. Sequential
d. Iteration
e. Control flow
Answer: c