logo

Your Questions / Our Solutions


Jese Leos

Helpdice Team

What is the difference between list and tuples in Python?

<table border="1" cellpadding="1" cellspacing="1" style="width:500px"> <thead> <tr> <th scope="row"><strong>LIST</strong></th> <th scope="col"><strong>TUPLES</strong></th> </tr> </thead> <tbody> <tr> <td>Lists are mutable i.e they can be edited.</td> <td>Tuples are&nbsp;immutable (tuples are lists which can&rsquo;t be edited).</td> </tr> <tr> <td>Lists are slower than tuples.</td> <td>Tuples are faster than list.</td> </tr> <tr> <td>Syntax: list_1 = [10, &lsquo;Chelsea&rsquo;, 20]</td> <td>Syntax: tup_1 = (10, &lsquo;Chelsea&rsquo; , 20)</td> </tr> </tbody> </table> <p>&nbsp;</p>
  • Share On: