generate functionWed, 08 Feb 2023

When playing "Cities", players take turns calling the names of cities so that the first letter of each new word coincides with the last letter of the previous one. At the same time, it is believed that if the last letter of the previous word is a soft sign, then the letter preceding the soft sign should be compared with the first letter of the next word. Write a program that reads two lines in a row, and then prints "Good" if the last character of the first line matches the first character of the second (subject to the soft sign rule), and "Bad" otherwise.

def cities(a, b): return a[-1] == b[0] or a[-2] == b[0] cities("Москва", "Ташкент")

Questions about programming?Chat with your personal AI assistant