Python Basic Tutorial

This post contains some basic syntax and usage in Python.


Part One

Methods in list.

'''
Basic methods about list
'''
list.append(x) #adds x to the end of the list
list.extend(L) #concatenates list L to the end of the other list
list.sort() #sorts the elements of the list
list.remove(x) #removes from the list the first element equal to x
list.pop() #removes the last element of the list and returns that element

 

This article was updated on January 25, 2020

MS Statistics Candidate at University of Michigan