get()
seek()
tell()
cur()
Provides a means of reuse of program code
Provides a means of dividing up tasks
Provides a means of reducing the size of the program
Provides a means of testing individual parts of the program
What is the datatype of x ?
import numpy as np a=np.array([1,2,3,4]) x=a.tolist()
int
array
tuple
list
Testing
Delivery
Idea
Development
What will be the output of the following code snippet?
d={3,4,5} for k in d: print(k)
{3, 4, 5},{3, 4, 5}, {3, 4, 5}
3 4 5
syntax error
None of the above
arrow
circle
box
parallelogram
f.seek(-10, 0)
f.seek(10, 0)
f.seek(-10,1)
none of the above
What is the output of the following code snippet?
print([i.lower() for i in "HELLO"])
hello
['h', 'e', 'l', 'l', 'o']
hel
HELLO
What will be the output of following?
Y=[2,5J,6] Y.sort()
[2,6,5J]
[5J,2,6]
Error
[6,5J,2]
What is the output of the following code?
import numpy as np a=np.array([1,2,3,5,8]) b=np.array([0,3,4,2,1]) c=a+b c=c*a print(c[2])
10
21
12
28
break
pass
continue
none of these
Which of the following error is returned by the given code ?
f = open("test.txt","w") f.write(345)
Syntax Error
Type Error
String Error
Run Time Error
What will be the output of the following algorithm for a=5, b-8, c=6 ?
Step 1: Start Step 2: Declare variables a, b and c. Step 3 Read variables a, b and c. Step 4: If a < b If a <c Display a is the smallest number. Else Display c is the smallest number. Else If b <c Display b is the smallest number. Else Display c is the smallest number Step 5:Stop
a is the smallest number
b is the smallest number
c is the smallest number
stop
Control flow
Terminal
Processing
Decision
What is the output of following code ?
a = np.array([[1,2,3],[4,5,6]]) print(a.shape)
(2,3)
(3,2)
(1,1)
f.readlines()
f.readline()
f.read()
f.line()
Loop
Process
None of these
RAM
CPU
ROM
Control Unit
def s(n1): print(n1) n1=n1+2 n2=4 s(n2) print(n2)
6 4
4 6
4 4
6 6
What is the output of the following?
x=123 for i in x: print(i)
1 2 3
123