$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #239

What goes in the blank?

# does the filename end with .txt?
ok = name.____('.txt')

Answer: endswith (also accepted: endswith, endswith(), endsWith)

str.endswith() tests the suffix of a string.
Play Problem Solving ▸