June 2018
Intermediate to advanced
294 pages
7h 5m
English
A list is a collection of items (for example, strings, numbers, objects, and so on). In other programming languages, it's called an array. Now, should you hear that word in the future, you'll know that it means a list in Python:
ips = ['192.1.1.1','192.1.1.254']
ips = ['192.1.1.1','192.1.1.254']# To add a third item to the listips.append('192.1.1.2')print ips
ips = ['192.1.1.1','192.1.1.254']# Print the first IP addressprint ips[0]
ips = ['192.1.1.1','192.1.1.254']# Assign the first item ...
Read now
Unlock full access