/home/brent/venv/Intro/bin/python /snap/pycharm-community/85/helpers/pydev/pydevconsole.py 41741 39625 import sys; print('Python %s on %s' % (sys.version, sys.platform)) sys.path.extend(['/home/brent/PycharmProjects/Intro']) PyDev console: starting. Python 3.6.5 (default, Apr 1 2018, 05:46:30) [GCC 7.3.0] on linux >>> [1,2,3] [1, 2, 3] >>> type([1,2,3]) >>> [] [] >>> ['hello', 'there', 'CSCI', '150'] ['hello', 'there', 'CSCI', '150'] >>> [[1,2,3], [4,5,6], [7,1,9,10]] [[1, 2, 3], [4, 5, 6], [7, 1, 9, 10]] >>> animals = ['dog', 'turtle', 'giraffe', 'echidna', 'seal'] >>> len(animals) 5 >>> animals[2] 'giraffe' >>> animals[1:3] ['turtle', 'giraffe'] >>> animals + ['horse', 'cow'] ['dog', 'turtle', 'giraffe', 'echidna', 'seal', 'horse', 'cow'] >>> 'ho' * 3 'hohoho' >>> animals * 3 ['dog', 'turtle', 'giraffe', 'echidna', 'seal', 'dog', 'turtle', 'giraffe', 'echidna', 'seal', 'dog', 'turtle', 'giraffe', 'echidna', 'seal'] >>> animals[2][4] 'f' >>> animals[0] = 'rhinoceros' >>> animals ['rhinoceros', 'turtle', 'giraffe', 'echidna', 'seal'] >>> greeting = 'hello' >>> greeting[0] = 'j' Traceback (most recent call last): File "", line 1, in TypeError: 'str' object does not support item assignment >>> animals.append('stegosaurus') >>> animals ['rhinoceros', 'turtle', 'giraffe', 'echidna', 'seal', 'stegosaurus'] >>> animals[6] = 'marmot' Traceback (most recent call last): File "", line 1, in IndexError: list assignment index out of range >>> animals.append('marmot') >>> animals ['rhinoceros', 'turtle', 'giraffe', 'echidna', 'seal', 'stegosaurus', 'marmot'] >>> animals + ['leopard'] ['rhinoceros', 'turtle', 'giraffe', 'echidna', 'seal', 'stegosaurus', 'marmot', 'leopard'] >>> animals ['rhinoceros', 'turtle', 'giraffe', 'echidna', 'seal', 'stegosaurus', 'marmot'] >>> animals = animals + ['leopard'] >>> animals ['rhinoceros', 'turtle', 'giraffe', 'echidna', 'seal', 'stegosaurus', 'marmot', 'leopard'] >>> animals += ['penguin'] >>> animals ['rhinoceros', 'turtle', 'giraffe', 'echidna', 'seal', 'stegosaurus', 'marmot', 'leopard', 'penguin'] >>> help(list) Help on class list in module builtins: class list(object) | list() -> new empty list | list(iterable) -> new list initialized from iterable's items | | Methods defined here: | | __add__(self, value, /) | Return self+value. | | __contains__(self, key, /) | Return key in self. | | __delitem__(self, key, /) | Delete self[key]. | | __eq__(self, value, /) | Return self==value. | | __ge__(self, value, /) | Return self>=value. | | __getattribute__(self, name, /) | Return getattr(self, name). | | __getitem__(...) | x.__getitem__(y) <==> x[y] | | __gt__(self, value, /) | Return self>value. | | __iadd__(self, value, /) | Implement self+=value. | | __imul__(self, value, /) | Implement self*=value. | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | __iter__(self, /) | Implement iter(self). | | __le__(self, value, /) | Return self<=value. | | __len__(self, /) | Return len(self). | | __lt__(self, value, /) | Return self None -- append object to end | | clear(...) | L.clear() -> None -- remove all items from L | | copy(...) | L.copy() -> list -- a shallow copy of L | | count(...) | L.count(value) -> integer -- return number of occurrences of value | | extend(...) | L.extend(iterable) -> None -- extend list by appending elements from the iterable | | index(...) | L.index(value, [start, [stop]]) -> integer -- return first index of value. | Raises ValueError if the value is not present. | | insert(...) | L.insert(index, object) -- insert object before index | | pop(...) | L.pop([index]) -> item -- remove and return item at index (default last). | Raises IndexError if list is empty or index is out of range. | | remove(...) | L.remove(value) -> None -- remove first occurrence of value. | Raises ValueError if the value is not present. | | reverse(...) | L.reverse() -- reverse *IN PLACE* | | sort(...) | L.sort(key=None, reverse=False) -> None -- stable sort *IN PLACE* | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | __hash__ = None >>> animals ['rhinoceros', 'turtle', 'giraffe', 'echidna', 'seal', 'stegosaurus', 'marmot', 'leopard', 'penguin'] >>> animals.sort() >>> animals ['echidna', 'giraffe', 'leopard', 'marmot', 'penguin', 'rhinoceros', 'seal', 'stegosaurus', 'turtle'] >>> animals.insert(3, 'skua') >>> animals ['echidna', 'giraffe', 'leopard', 'skua', 'marmot', 'penguin', 'rhinoceros', 'seal', 'stegosaurus', 'turtle']