0% found this document useful (0 votes)
139 views3 pages

Grade 7 - Computer Chapter 4 Notes - 23082024 - 105655

Documents class 7 cbse

Uploaded by

medi6268elect
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views3 pages

Grade 7 - Computer Chapter 4 Notes - 23082024 - 105655

Documents class 7 cbse

Uploaded by

medi6268elect
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Chapter4: Operators In Python

EXERCISES
A. Multiple Choice Questions
Ans. 1. (b) 2. (b) 3. (a) 4. (a) 5. (c)
B. Fill in the blanks.
Ans. 1. Operators
2 Unary
3 Floor
4. Not equals to
5. multiple
C. Write T for true and F for false statements.

1. T

2. F

3. T

4 F

D Very Short Answer Questions


Ans. 1. Operators are the symbols that perform some operations on values called operands.
Ans. 2. AND operator returns TRUE if both the expressions are true else it returns FALSE.
Example x= 10 ANDx <y
Ans. 3. A bug is an error in the program. Any events that occurs unexpectedly and resuts in
different output is due to a bug.
E. Short Answer Questions
Ans. 1. When two operators with the same precedence occur in the same expression, then the
interpreter executes them either from right to left or left to right based on their level. This
is known as associativity.
2. Logical error are also known semantic errOrs. They do give results. But the results are
wrong as the logic written for them are wrong.
Example X=5
y= 8
3 =x + y/10
Answer=5.8 which is wrong
You should brackets with x + y
Z= (x + y/10
= 1.3 which is correct
Syntax error - check plural of syntax are the rules folowed by the language. When these
rules are not followed, then you get syntax error.
Example>>> Print (hello")
(invalid syntax)
# type print in lowercase to remove syntax error >>> print ("hello")
(hello)
Knowing these errors helps you saves time in correcting them.
Long Answer Questions
Ans. 1. They are also known as comparison operators because they compare two values and
return the boolean value, i.e., either True or False. Python uses the relational operators
like:
Python Comparison Operators
Symbol Meaning Example Result
Less than 5<2 False
Greater than 5>2 True
<= Less than or equal to 5<=2 False
Greater than or equal to 5>=2 True
==
Equal to 5==2 False
!= Not equal to 5!=2 True

Ans. 2. Concatenations operator adds values on either side of the operator.


Example, a + bwill give Hello Python
Here a = Hello
b= Python
Ans. 3. The term precedence simply means an order of priority. Most of the time, while
programming, you encounter expressions where there are more than one operators. In
such situation, the operations take place based on the precedence and associativity of the
operators.
Operator Description
) Parenthesis (grouping)
Exponentiation
+x, -x Positive, negative
*,1J|, % Multiplication, division, floor division, modulus
Higher to
+, Addition, subtraction Lower
Precedence
<, <=,,>=,!=, == Comparisons, membership, identity
not Boolean NOT
and Boolean AND
or Boolean OR

x = int (input ("Enter the number"))


y= Not x print ("Changed sign", y)
Computer In Everyday Life (Application-based Questions)
1. Shubham should use relational operator to compare two numbers.
2. Rishi should use logical operator. He should test the condition and print the result.

You might also like