When do you use the list and tuple in Python?
Some methods return lists and some methods return tuples, and I wonder by what criteria you made them.
"Hello %s you are %s years old" %x #Tuple only available
If you can use both of them instead of just one,
Which one should I use, a list or a tuple?
list python type
Because of this nature, tuples are often used when read-only data (const) is required. (Of course, you don't have to put only a single type in the list, so you can use it however you want)
© 2024 OneMinuteCode. All rights reserved.