Font size
Worksheetsinfytq sample test 2
Total questions: 60
Worksheet time: 3600secs
Чему равно "a" после выполнения программы?
a = 2
If a<3:
print(a+1)
else:
print(a-1)
3
2
1
0
x = 3
c = 0
while x > 1:
c = c +1
x = x -1
3
0
1
2
Which one will display when this code is run?
7
9
A python is a non-venomous snake
done
A python is a non-venomous snake
A python is a non-venomous snake
done
A python is a non-venomous snake
A python is a non-venomous snake
A python is a non-venomous snake
done
print("3*4+5")
cakeAmount = raw_input()
print "We have", cakeAmount, " cakes"
The above code is run. You type:
six
Select the correct output.
We have six cakes
We have 6 cakes
We havesix cakes
Syntax Error
age = input("Enter Age (as integer): ")
newAge = age + 20
print ("your age in 20 years is:", newAge)
you enter
15
value of age is 15
value of newAge is 35
output is: your age in 20 years is: 35
value of age is 15
value of newAge is 20
output is: your age in 20 years is: 20
value of age is 15
value of newAge is "age + 20"
output is: your age in 20 years is: 35
value of age is 15
value of newAge is 35
output is: your age in 20 years is:35
Let x= "Python", the output of
print(x[0])
print(x[-1])
print(x[-2])
P
N
O
p
O
n
t
h
y
P
n
o
What will this code print?
Print the word 'letter'.
Print a user input on one line.
Print a user input one letter at a time.
Print an Error.
What will be the output of this code?
1,2,3,4,5,6,7,8,9,10,11,12
0,2,4,6,8,10
2,4,6,8,10,12
2,4,6,8,10
France
Wales
Wales
France
Find the Output:
Item = {"ECE" , "CSE" , "EEE" , "CIVIL"}
Item.add (2,"MECH")
print(Item)
{ "ECE" , "MECH" , "CSE" , "EEE" , "CIVIL" }
{ "ECE" , "CSE" , "MECH" , "EEE" , "CIVIL" }
{ "ECE" , "CSE" , "EEE" , "CIVIL" }
{ "ECE" , "CSE" , "EEE" ,"MECH" , "CIVIL" }
What is the output for the below code
a=b=c = 1,2,3
print(a,b,c)
1 2 3
(1, 2, 3) (1, 2, 3) (1, 2, 3)
Syntax Error
Logical Error
Integrity constraints ensure that changes made to the database by authorized users do not result into loss of data consistency. Which of the following statement(s) is (are) true w.r.t. the examples of integrity constraints ?
(i) An instructor Id. No. cannot be null, provided Intructor Id No. being primary key.
(ii) No two citizens have same Adhar-Id.
(iii) Budget of a company must be zero.
(i), (ii) and (ii) are true.
(i) false, (ii) and (iii) are true.
(i) and (ii) are true; (iii) false.
0
1
error
none of the mentioned
[[[0]], [[[0]], [1]], [[[0]], [[[0]], [1]], [2]]]
[[0], [[0], 1], [[0], [[0], 1], 2]]
[0, None, 1, None, 2, None]
[[[0]], [[[0]], [1]], [[[0]], [[[0]], [1]], [2]]]
Welcome# 111#924.66
Welcome#111#924.66
Welcome#111#.66
Welcome # 111#924.66
To retrieve the character at index 3 from string s=”Hello” what command do we execute (multiple answers allowed)?
s[]
s.getitem(3)
s.__getitem__(3)
s.getItem(3)
True False
True True
Run Time Error
False False
What function do you use to read a string?
input(“Enter a string”)
eval(input(“Enter a string”))
enter(“Enter a string”)
eval(enter(“Enter a string”))
Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?
[2, 33, 222, 14]
Error
25
[25, 14, 222, 33, 2]
11
12
21
22
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop()?
[3, 4, 5, 20, 5, 25, 1]
[1, 3, 3, 4, 5, 5, 20, 25]
[3, 5, 20, 5, 25, 1, 3]
[1, 3, 4, 5, 20, 5, 25]
What will be the output of the following Python code?
"Welcome to Python".split()
[“Welcome”, “to”, “Python”]
(“Welcome”, “to”, “Python”)
{“Welcome”, “to”, “Python”}
“Welcome”, “to”, “Python”
The program prints two rows 3 4 5 1 followed by 33 6 1 2
The program prints on row 3 4 5 1 33 6 1 2
The program prints two rows 3 4 5 1 followed by 33 6 1 2
The program prints two rows 1 3 4 5 followed by 1 2 6 33
[[1, 2], [3, 1.5], [0.5, 0.5]]
[[3, 1.5], [1, 2], [0.5, 0.5]]
[[0.5, 0.5], [1, 2], [3, 1.5]]
[[0.5, 0.5], [3, 1.5], [1, 2]]
What will be the output of the following Python code?
print("xyyzxyzxzxyy".count('xyy', -10, -1))
2
0
1
error
Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.
SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)
SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN (‘sunny’, ‘cloudy’)
SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’, ‘cloudy’)
SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (‘sunny’, ‘cloudy’);
With SQL how can I return all items in the Item table sorted from the lowest priced to the highest priced?
SELECT * FROM Items ORDER BY Price ASCENDING
SELECT * FROM Items ORDER BY Price ASC
SELECT * FROM Items BY Price LOWEST TO HIGHEST
SELECT * FROM Items ORDER BY Price DESC
With SQL, how can you return the number of records in the "Persons" table?
SELECT NO(*) FROM Persons
SELECT COUNT(*) FROM Persons
SELECT LEN(*) FROM Persons
v_num is not equal to v_char
compilation error
v_num is equal to v_char
runtime error
Which choice shows what I will see on the screen after the following block is executed?
-1
VALUE_ERROR
-1
TOO_MANY_ROWS
3
NO ERROR
1
NO ERROR
Match SQL language with SQL commands
1)DDL i)Revok, Grant
2)DML ii)rename a table
3)TCL iii)insert, update
4)DCL iv)rollback , commit
1-iii,2-i,3-ii,4-iv
1-iii,2-ii,3-iv,4-i
1-ii,2-iii,3-iv,4-i
1-i,2-iii,3-ii,4-iv
The Entity Customer has three candidate keys: a) CustId b) Email and c) ContactNo. Suggest the best primary key for this entity.
CustId
ContactNo
CustId and ContactNo
Find the odd one out
AC
EF
VX
QS
B
D
I
K
The time of the watch is
2:31
3:13
3:55
4:37
?
What will be the next time?
5:25
5:00
5:19
5:05
If 20% of a = b, then b% of 20 is same as
4% of a
5% of a
20% of a
None of these
Accept means
consent to receive
natural ability
buy or obtain
to try
if 15% of (A+B) = 25% of (A-B), then what percent of B is equal to A?
(a)
A sum of money at simple interest doubles in 7 years. It will becomes four times in
18years
21years
38years
42years
In how many ways can the letters of the word MACHINE be arranged so that the vowels may occupy the odd Positions
576
210
144
1024
The small child does whatever his father was done.
has done
did
does
had done
No correction required
