Код: Выделить всё
reference = "file"
modifier = "read"
print(f"unknown pattern") # Should output "file.read" since modifier is not empty
modifier = ""
print(f"unknown modifier") # Should output "file" (not "file.") since modifier is empty
Я бы хотелось бы избегать использования str.join() или условных операторов, если это возможно.
Подробнее здесь: https://stackoverflow.com/questions/790 ... ng-a-value