I found a small bug

In the Intro to strings when I wasn’t getting the correct response for the exercise, the syntax error help thing was giving the wrong info about the exercise.


I finished the exercise. I just wanted to let someone know that there was a small bug in that program.

The error message is correct.

Take a look at line 5 of your code.

first_name[:-3] should be changed to first_name[-3:] if you want “lie” instead of “Ju” as a result.

The SCT for the lesson runs your code using additional ‘test cases’. That’s why you see the name, “Julie Blevins” instead of “Reiko Matsuki” in the error message.

1 Like

Thanks @midlindner. I didn’t know it would test other cases.


If all we had to do is produce the correct output for the single case, we could effectively cheat by doing something like this:

first_name = "Reiko"
last_name = "Matsuki"

def password_generator(first_name, last_name):
  return 'ikouki'

temp_password = password_generator(first_name, last_name)

The additional test cases force us to write code that will work with various inputs.