Tuple creation variations
Tuple can also be created directly like lists by item values assignment in a parentheses. Other ways are to use constructor based creations using tuple() function. Single value tuple creation needs an extra comma after the item value.
Source Code
|
|
Run Output
Notes
- The function tuple() is called the constructor, which can be used to convert one form to another..
- Watch for extra comma ( , ) while created a single item tuple.
- Tuple concatenation always creates a new tuple without affecting values of the tuple being concatenated.
Suggested Filename(s): tuple_creation.py
Created: 9-Jul-2026 18:57 | Updated: 29-Sep-2026 15:57|
