-Python- a=3 b=5 print('a**b+(20*a-8+b)%2') ============================ Ketika koding ini di Run, maka tampaklah hasilnya; a.) a**b+(20*a-8+b)%2 b.) 'a**b+(20*a-8+b)%2' c.) 16 d.) 244
Ketika kode dijalankan, hasil yang akan ditampilkan adalah string 'a**b+(20*a-8+b)%2' karena itu yang dicetak menggunakan fungsi print().
Nilai a dan b sebenarnya tidak digunakan dalam ekspresi yang dicetak, sehingga hasil yang diharapkan mungkin adalah sesuatu yang lain. Jika kita ingin menghitung nilai ekspresi tersebut, kita dapat mengganti baris print() menjadi:
print(a**b+(20*a-8+b)%2)
Dengan cara ini, hasil yang akan ditampilkan adalah 244.
Jawaban:
a.) a**b+(20*a-8+b)%2
Penjelasan:
Ketika kode dijalankan, hasil yang akan ditampilkan adalah string 'a**b+(20*a-8+b)%2' karena itu yang dicetak menggunakan fungsi print().
Nilai a dan b sebenarnya tidak digunakan dalam ekspresi yang dicetak, sehingga hasil yang diharapkan mungkin adalah sesuatu yang lain. Jika kita ingin menghitung nilai ekspresi tersebut, kita dapat mengganti baris print() menjadi:
print(a**b+(20*a-8+b)%2)
Dengan cara ini, hasil yang akan ditampilkan adalah 244.