Используя функциональное программирование, создайте список предложений, описывающих каждого человека: "Любимый цвет Евгения - синий, любит играть в теннис и есть фрикадельки".
##Весь словарь переписывать не стал, думаю, сам справишься
def getinfo(voc):
return f"Eugen`s favourite color is {preferences['Eugen']['Favourite Color']}, he enjoys playing {preferences['Eugen']['Favourite Sport']} and eating {preferences['Eugen']['Favourite Food']}\nJohn`s favourite color is {preferences['John']['Favourite Color']}, he enjoys playing {preferences['John']['Favourite Sport']} and eating {preferences['John']['Favourite Food']}"
Answers & Comments
Ответ:
preferences = {"Eugen" : {"Favourite Color" : "Blue", "Favourite Sport" : "Tennis", "Favourite Food" : "Meatballs"},
"John" : {"Favourite Color" : "Red", "Favourite Sport" : "Baseball", "Favourite Food" : "Pizza"}}
##Весь словарь переписывать не стал, думаю, сам справишься
def getinfo(voc):
return f"Eugen`s favourite color is {preferences['Eugen']['Favourite Color']}, he enjoys playing {preferences['Eugen']['Favourite Sport']} and eating {preferences['Eugen']['Favourite Food']}\nJohn`s favourite color is {preferences['John']['Favourite Color']}, he enjoys playing {preferences['John']['Favourite Sport']} and eating {preferences['John']['Favourite Food']}"
print(getinfo(preferences))