import os for num in range(1, 6): path = os.path.join("img", f"Samurai{num}.png") print("Checking:", path) print("Exists?", os.path.exists(path))