THIS IS FOR PYTHON CODE
Given 3 words, print the three words in alphabetical order. The program MUST use only if statements.
For example, if the words are:
Jessi Anna and Fred
The program would print:
Anna Fred Jessi
s = input().split() a = s[0] b = s[1] c = s[2] if(a<b and a<c): print(a,end=" ") if(b<c): print(b, end=" ") print(c,end="") else: print(c,end=" ") print(b, end="") elif(b<a and b<c): print(b,end=" ") if(a<c): print(a, end=" ") print(c,end="") else: print(c,end=" ") print(a, end="") else: print(c, end=" ") if (a < b): print(a, end=" ") print(b, end="") else: print(b, end=" ") print(a, end="")
Get Answers For Free
Most questions answered within 1 hours.