Quantcast
Channel: Add variables to tuple - Stack Overflow
Viewing all articles
Browse latest Browse all 10

Answer by mipadi for Add variables to tuple

$
0
0

It's as easy as the following:

info_1 = "one piece of info"info_2 = "another piece"vars = (info_1, info_2)# 'vars' is now a tuple with the values ("info_1", "info_2")

However, tuples in Python are immutable, so you cannot append variables to a tuple once it is created.


Viewing all articles
Browse latest Browse all 10

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>