İçeriğe atla
CodeItRaw
Kod Okuma
/
Kelimeleri Ters Çevir
Yol
Oyna
Günlük
Liderlik
en
Hatayı Bul
Kelimeleri Ters Çevir
"a b c" için "c b a" döndürmeli, ama cümleyi olduğu gibi geri veriyor. Hatalı satırı ve türünü bul.
Hatalı olduğunu düşündüğün satıra tıkla.
1
def
reverse_words
(text):
2
stack = []
3
for
word
in
text.split():
4
stack.append(word)
5
out = []
6
while
stack:
7
out.append(stack.pop(
0
))
8
return
" "
.join(out)