Skip to content

Latest commit

 

History

History
26 lines (15 loc) · 480 Bytes

File metadata and controls

26 lines (15 loc) · 480 Bytes

[ : , 0 ]meas (more or less)[ first_row:last_row , column_0 ]- you have 2-dimensional list/matrix/array and you get all values in column 0 (from all rows).

slice

last item: list[-1]

last two item: list[-2:]

everything before the last two item: list[:-2]

all item in arr reversed: list[::-1]

join arr into str

list1 = ['1','2','3','4'] 
 
s = "-"
 
# joins elements of list1 by '-'
# and stores in sting s
s = s.join(list1)

output: 1-2-3-4