The following example code demonstrates How to Create a Tuple in Python.
Since it is not possible to assign values to a specific element of a tuple. Therefore, the corresponding statements in the following code will result in an error.
nm = "Joe"
print(nm)
#nm[0] = 'C'
nma = ('J', 'O', 'E', 'BDN')
print(nma)
#nma[0] = 'HRY'
Output
![An Example Demonstrating How to Create a Tuple in Python](https://www.programmingempire.com/wp-content/uploads/2023/01/image-24.png)
More examples on tuples are given here.
Further Reading
Examples of OpenCV Library in Python
A Brief Introduction of Pandas Library in Python
A Brief Tutorial on NumPy in Python
- Angular
- ASP.NET
- C
- C#
- C++
- CSS
- Dot Net Framework
- HTML
- IoT
- Java
- JavaScript
- Kotlin
- PHP
- Power Bi
- Python
- Scratch 3.0
- TypeScript
- VB.NET
![programmingempire](https://www.programmingempire.com/wp-content/uploads/2021/10/pefavicon.png)