Computer Science, asked by ZiaullahZia, 3 months ago

write an algorithm to find the youngest of two brothers Ali and Junaid.​

Answers

Answered by jai696
1

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

def yungest(ages):

if len(set(ages.values())) == 1:

return "Same ages!"

sorted_ages = dict(sorted(ages.items(), key = lambda item: item[1]))

return list(sorted_ages)[0] + " is the youngest!"

ali_age, junaid_age = int(input("ali_age: ")), int(input("junaid_age: "))

print(yungest({"Ali": ali_age, "Junaid": junaid_age}))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by amritamohanty918
1

Answer:

def yungest(ages):

def yungest(ages):if len(set(ages.values())) == 1:

def yungest(ages):if len(set(ages.values())) == 1:return "Same ages!"

def yungest(ages):if len(set(ages.values())) == 1:return "Same ages!"sorted_ages = dict(sorted(ages.items(), key = lambda item: item[1]))

def yungest(ages):if len(set(ages.values())) == 1:return "Same ages!"sorted_ages = dict(sorted(ages.items(), key = lambda item: item[1]))return list(sorted_ages)[0] + " is the youngest!"

def yungest(ages):if len(set(ages.values())) == 1:return "Same ages!"sorted_ages = dict(sorted(ages.items(), key = lambda item: item[1]))return list(sorted_ages)[0] + " is the youngest!"ali_age, junaid_age = int(input("ali_age: ")), int(input("junaid_age: "))

def yungest(ages):if len(set(ages.values())) == 1:return "Same ages!"sorted_ages = dict(sorted(ages.items(), key = lambda item: item[1]))return list(sorted_ages)[0] + " is the youngest!"ali_age, junaid_age = int(input("ali_age: ")), int(input("junaid_age: "))print(yungest({"Ali": ali_age, "Junaid": junaid_age}))

Similar questions