Python Tuple Met Een Item
Skep Tuple Met Een Item
Om 'n tupel met slegs een item te skep, moet jy 'n komma na die item byvoeg, tensy Python nie die veranderlike as 'n tupel sal herken nie.
Voorbeeld
Een item tupel, onthou die komma:
thistuple = ("apple",)
print(type(thistuple))
#NOT a tuple
thistuple = ("apple")
print(type(thistuple))