XIComp SC Term1320
XIComp SC Term1320
Q.15 Drive the Boolean expression for the logic circuit shown below:
Q.16 The logic gate that will have HIGH or “1” at its output when any one of its input
is HIGH is a(n):
(a) NOT operation (b) OR gate (c) AND gate (d) NOR gate
Q.19 Modern Computers are very reliable but they are not:
(a)Fast (b) Powerful (c) Infallible (d)Cheap
Q.31 Ahaana wants to make a fun program , if user enters any postitive number a “Good” or if
number is negative a “funny” message will appear . She is confused that which is the most suitable
control to be used to make such program. Help her to choose correct option.
(a) if (b) if else (c) if elif (d)nested if
Q.35 sum = 0
values = [1,3,5,7]
for number in values:
sum = sum + number
print(sum)
find output of the above given code :
(a) 0 (b) 12 (c) 16 (d) 7
Q.36
z = "xyz"
j = "j"
while j in z:
print(j, end=" ")
(A) Both(A) and (R) are true and (R) is a correct explanation of Assertion
(B) Both (A) and (R) are true, but (R) is not the explanation of Assertion
(C) If the assertion is true but Reason is false.
(D) If both Assertion and Reason are false.
(a) Both(A) and (R) are true and (R) is a correct explanation of Assertion
(b) Both (A) and (R) are true, but (R) is not the explanation of Assertion
(c) If the assertion is true but Reason is false.
(d) If both Assertion and Reason are false.
Q.43 x=3
if x>2 or x<5 and x==6:
print("ok")
else:
print("no output") # find output
(a) no output (b) Error (c) ok (d) first ok than no output
Q.44 Error in which statements are not meaning full is known as:
(a) syntax error (b) run time error (c) compile time error (d) semantic error
Q. 46 find output :
name = "maya"
if name == "saya":
print("delhi")
elif name == "mana":
print("mumbai")
else:
print("india")
Expressions in programming are like formulas in mathematics: both use values (in Python
literals and names bound to values) to compute a result. But unlike mathematics, expressions in
Python can compute results of a wide variety of types (e.g., boolean and string) not just mathematical
results.
We classify these operators, both symbols and identifiers, into four categories and examine
them separately: Arithmetic (+ -* / // % **), Relational: (== != < > <= >= is in), Logical (and not or),
and finally Bitwise (& | ~ ^ << >>)
When two or more operators share an operand with the same precedence, such as a * b / c, the
expression is evaluated according to associativity. When all of the operators in an expression have
the same precedence, the expression is evaluated using left to right associativity.Now, since the **
operator has right-to-left associativity, a ** b ** c will be evaluated as a ** (b ** c). For
exponentiation, the expression on the right is evaluated first. On the other hand, since the * operator
has left-to-right associativity, a * b * c is treated as (a * b) * c. For multiplication, the expression on
the left is evaluated first.
Q.53 % is known as the modulus operator and if a =13 and b =2 then a % b evaluate to __.
(a) False , 0 b) True , 6 c) True , None d) None of These
Q.54 State true or false the statement : ** operator is evaluate right to left and * is left to right
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&