[Solved] I need help Funtion sort a-z condition [closed]


Hope you got the logic from my code below, if you have any questions, please ask them 😀

name1 = input("Name 1 : ")
name2 = input("Name 2 : ")
choose = input("Select first or last : ")

if choose == "first":
    if name1 < name2: # check if name1 is in front of name2 (alphabetical)
        print(name1)
    else:
        print(name2)
else:
    if name1 > name2: # check if name1 is after name2 (alphabetical)
        print(name1)
    else:
        print(name2)

0

solved I need help Funtion sort a-z condition [closed]