Search

Basic

command to make a python script and have terminal available for use at the same time (the & is the most important):

mousepad first.py&

a shorter version of:

age = age + 1

IS

age += 1

Truth Table:

image

Lists

returns the index 1 item and until but not including index 3

es = ["Gran Turismo", "Hangover", "The Exorcist", "FnF"]
print(movies[1:3])

Everything until index 1:

print(movies[:1])

Return last item in list:

print(movies[-1])
movies.append("Inception")

remove last item:

movies.pop()

remove first item:

movies.pop(0)

2D List

grades = [["Bob", 82], ["Alice", 90], ["Jeff", 73]]
bobsGrade = grades[0][1]

I wanna pull from the first index ([”Bob”, 82]), the 2nd element (index 1)