-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPCEP-30-02 1.4 operators and data t.txt
154 lines (128 loc) · 2.61 KB
/
PCEP-30-02 1.4 operators and data t.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
PCEP-30-02 1.4 operators and data types:
1. What is the result of 5 ** 2?
A: 25
B: 10
C: 7
D: 52
2. Which operator is used for floor division in Python?
A: /
B: //
C: %
D: **
3. What is the output of "Python" * 2?
A: PythonPython
B: Python2
C: Error
D: Python * 2
4. Which of the following is a valid shortcut operator in Python?
A: x =+ 5
B: x += 5
C: x =+ = 5
D: x + = 5
5. What is the result of 10 % 3?
A: 3
B: 1
C: 0
D: 3.33
6. Which operator has higher precedence?
A: +
B: *
C: //
D: %
7. What is the output of 5 & 3?
A: 8
B: 1
C: 2
D: 15
8. Which of the following is the correct way to perform a bitwise left shift?
A: 5 << 1
B: 5 >> 1
C: 5 < 1
D: 5 > 1
9. What is the result of not True and False?
A: True
B: False
C: None
D: Error
10. Which of the following is NOT a relational operator in Python?
A: ==
B: !=
C: <>
D: >=
11. What is the output of 0.1 + 0.2 == 0.3?
A: True
B: False
C: Error
D: None
12. How do you convert an integer to a float in Python?
A: int(x)
B: float(x)
C: str(x)
D: complex(x)
13. What is the result of 5 ^ 3?
A: 6
B: 8
C: 2
D: 15
14. Which operator is used for string concatenation?
A: &
B: +
C: *
D: ,
15. What is the output of 10 // 3?
A: 3
B: 3.33
C: 3.0
D: 4
16. Which of the following has the highest precedence?
A: ()
B: **
C: *
D: +
17. What is the result of True or False and not True?
A: True
B: False
C: None
D: Error
18. Which bitwise operator inverts all the bits?
A: ~
B: ^
C: |
D: &
19. What is the output of 5 > 3 > 1?
A: True
B: False
C: Error
D: None
20. How do you perform integer division in Python 3?
A: /
B: //
C: %
D: int()
21. What is the result of 2 << 2?
A: 4
B: 8
C: 16
D: 1
22. Which of the following is NOT a valid assignment operator in Python?
A: +=
B: -=
C: *=
D: =+
23. What is the output of 3 * "2" + "4"?
A: 10
B: 224
C: 222
D: Error
24. What is the result of 7 | 2?
A: 5
B: 7
C: 2
D: 9
25. How do you convert a float to an integer in Python?
A: int(x)
B: floor(x)
C: round(x)
D: ceil(x)
Answers:
1. A, 2. B, 3. A, 4. B, 5. B, 6. B, 7. B, 8. A, 9. B, 10. C, 11. B, 12. B, 13. A, 14. B, 15. A, 16. A, 17. A, 18. A, 19. A, 20. B, 21. B, 22. D, 23. B, 24. B, 25. A