December 2016
Beginner
197 pages
4h 18m
English
© Sanjib Sinha 2017
Sanjib Sinha, Beginning Ethical Hacking with Python, 10.1007/978-1-4842-2541-7_18
Sanjib Sinha1
(1)Howrah, West Bengal, India
In Python tuples and lists are array types. Tuples are immutable but lists are mutable. Tuples are used with comma operator and you can iterate through the tuple quite easily. As tuples are immutable, you can not add or update the value of a tuple. In lists, you can update or add new values quite easily. Open up your terminal in Linux and IDLE in Windows. Write down the code below and see the output yourself. Please read the comments that are attached with the code .
<code>#!/usr/bin/python3tuples1 = 1, 2, 3, 4print(type(tuples1))print(id(tuples1))tuples2 = (1, 2, 3, 4)print(type(tuples2)) ...
Read now
Unlock full access