Typecasting: konversi tipe data

Typecasting atau type conversion adalah teknik mengubah (melakukan konversi) tipe data suatu nilai dari satu tipe data ke tipe data lainnya.

Konversi antara tipe int dan float

Perhatikan contoh di bawah untuk memahami cara konversi sebuah nilai variabel dari int ke float dan sebaliknya.

Konversi antara tipe numerik (int,float) dan teks (str)

Perhatikan contoh di bawah ini untuk contoh cara konversi nilai variabel dari str ke int/float dan sebaliknya.

You may also like...

Berikan komentar

Belajar koding untuk pemula
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.