<jupyter_start><jupyter_text>List comprehension<jupyter_code>students_marks_above_80 = \
[student for student in student_marks if student[1] > 80]
students_marks_below_80 = \
[student for student in student_marks if student[1] < 80]
students_marks_above_80,students_marks_below_80
students_marks_above_80 + students_marks_below_80
sample_list = [1,2,3]
sample_list.extend([5,6])
sample_list
[1,2,3] + [5,6]
list_of_splits = []
# loop through input list
# create a sublist when you have iterated split_size elements
# append this sublist to the list_of_splits
x = [1, 2, 3, 4, 5]
split_size = 2
[[1,2],[3,4],[5]]
x = [1, 2, 3, 4, 5]
split_size = 7
[[1, 2, 3, 4, 5]]
def split_list(input_list,split_size):
    list_of_splits = []
    num_splits = len(input_list)// split_size
    even_splits = len(input_list) % split_size == 0
    num_splits = num_splits if even_splits else num_splits+1
    for i in range(num_splits):
        begin_marker = i*split_size
        list_of_splits.\
        append(input_list[begin_marker:begin_marker+split_size])
    return num_splits,list_of_splits
split_list([1,2,3,4,5],4)
x = [1,2,3,4,5]
x[0:2]
x[2:4]<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup