Page 17 - Jom Belajar Pengaturcaraan Python
P. 17
7.
x y x and y x or y
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 1
8.
x not x
0 1
1 0
9.
Operator Perbandingan Nilai
(a) 5 < 8 1
JAWAPAN
(b) 9 == 6 0
(c) 13 != 31 1
(d) 15 >= 12 1
(e) 7 != 7 0
(f) 11 > 14 0
(g) 16 <=19 1
(h) 14 == 14 1
(i) 7 < 3 0
(j) 18 >= 28 0
10.
(a) 59 – 35 24 (d) 83 % 6 5
(b) 47 * 16 752 (e) 39 // 5 7
(c) 75 / 4 18.75 (f) 8 ** 4 4096
J2
Jawapan.indd 2 9/5/19 10:50 AM

