Python Tuple Dengan Satu Item
Buat Tuple Dengan Satu Item
Untuk membuat tuple dengan hanya satu item, Anda harus menambahkan koma setelah item, kecuali jika Python tidak akan mengenali variabel sebagai tuple.
Contoh
Satu item tuple, ingat koma:
thistuple = ("apple",)
print(type(thistuple))
#NOT a tuple
thistuple = ("apple")
print(type(thistuple))