forked from fenyx-it-academy/Class4-PythonModule-Week3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlphabeticalOrder.py
More file actions
10 lines (10 loc) · 854 Bytes
/
AlphabeticalOrder.py
File metadata and controls
10 lines (10 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
print("-"*75)
print(str("-") *30 +"ALPHABETICAL ORDER"+ str("-")*27)
print("-"*75)
def alphabetical_order(): # alphabetical_order adinda bir function yaziyoruz.
word=input("Enter some words with a (-) between them ")# user dan aralarinda - olan kelimeler istiyoruz.
word=word.lower() # buyuk harf kullaniminin onune gecmek icin harfleri kucultuyoruz.
word_split=sorted(word.split("-")) # yazilan kelimeri - isaretinden split yapip siraliyoruz.
result= "-".join(word_split) #kelimeler arasina join metodu nu kullanarak - ekliyoruz.
return result # ve result u return yapiyoruz.
print(alphabetical_order()) # function u cagiriyoruz.