You have one pipeline and want to try several neighbour counts without rebuilding it each time.
Task: write neighbour_sweep(k_values).
load_breast_cancer(return_X_y=True, as_frame=True).train_test_split(X, y, test_size=0.25, random_state=0, stratify=y).make_pipeline(StandardScaler(), KNeighborsClassifier()).k in k_values, in order: set the pipeline's neighbour count to k, fit it on the training rows, and score it on the test rows.Return the list of test accuracies, each rounded to 3 decimal places, in the same order as k_values.