
Admin
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 immutable (tuples are lists which can’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, ‘Chelsea’, 20]</td>
<td>Syntax: tup_1 = (10, ‘Chelsea’ , 20)</td>
</tr>
</tbody>
</table>
<p> </p>
Related QNA's
- Explain Raspberry Pi ?...1 day ago