Pmd091023 (12/10/23)

1.What will be output for 100/25 expression?
4.0
4
0.04
4.00

2.And, Or and Not all are examples of?
Arithmatic Operators
Logical Operators
Comparison Operators
Assignment Operators

3.Select the mutable datatype from below options
int
str
dict
None of the above

4.Which operator can be used to compare two values?

<
=
<>

5.What will be the output of this statement:
print(“p” in “Python”)

True
False
Error

6.Which of the following is not a valid python operator?

==
%
++
&

7.What is the output of the following code:
print(9//2)

4.5
4.0
4
error

8.What will be the output of the following Python code snippet?
not(3>4)
not(1&1)

True, True
True, False
False, True
False, False

9.Which of the following is a valid python statement?

colors = [“Red”, ‘Blue’, Green]
first-name = “Tom”
numbers = [10, 20, 30, “Python”, ‘Java’]
All of the above

  1. What is the value of the given expression(using operator precedence)?
    2-5+1-7*3
1 Like
  1. 4.0
  2. Logical Operators
  3. dict except keys are immutable
  4. < , =
  5. False
  6. ++
  7. 4
  8. True, False
  9. None
  10. -23
    Solution :- (2-5)+1-(7*3)
    -3+1-21 = -23
1 Like
  1. 4.0
  2. Logical Operators
  3. Dict
  4. <, =
  5. False, case-sensitive
  6. ++
  7. 4
  8. True, False
  9. If first_name = “Tom” - otherwise none
  10. 2 - 5 + 1 - (7 * 3)
    (2 - 5) + 1 - 21
    (- 3 + 1) - 21
    (- 2 - 21)
    (-23)
1 Like
  1. 4.0
  2. Logical
  3. Dict
  4. < , =
  5. True
  6. ++
  7. 4
  8. True , False
  9. numbers = [10, 20, 30, “Python”, ‘Java’]
  10. -23
1 Like
  1. Question
    4.0

  2. Question
    Logical Operators

  3. Question
    Dict

  4. Question
    <

  5. Questioin
    True

  6. Question
    ++

  7. Question
    4

  8. Question
    True, False

  9. Question
    None

  10. Question
    23

1 Like

1)4.0

2)Logical Operators

3)dict

4)< =

5)False

6)++

  1. 4

  2. True , False

9)numbers =[10,20,30,“Python”,‘Java’]

  1. -23
1 Like

1… 4.0
2. logical operator
3. Dict
4. <,=
5. true
6. ++
7. 4
8. True, False
9. numbers = [10, 20, 30, “Python”, ‘Java’]
10. 2-5+1-73 = -23
----> As per BODMAS or PEMDAS rule
…multiplication comes first…-7
3=-21
…Addition comes second…-5-21=-26& 2+1=3
----->subtract___>3-26 + -23

1 Like
  1. 4.0
  2. Logical Operators
  3. dict except keys are immutable
  4. < , =
  5. False
  6. ++
  7. 4
  8. True, False
  9. None
  10. -23
    Solution :- (2-5)+1-(7*3)
    -3+1-21 = -23
1 Like
  1. 4.0
  2. Logical Operators
  3. Dict
  4. < , =
  5. False
  6. ++
  7. 4.5
  8. true, false
  9. none
  10. -23
1 Like