Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1sza funkcja, która działa
- def song_decoder(song):
- temp=[]
- for w in song.split("WUB"):
- if w!="":
- temp.append(w)
- return " ".join(word[::] for word in temp)
- #2 fkcja, nie działa ale bardziej zwięzła i czemu nie działa?
- def song_decoder(song):
- temp=[]
- return " ".join(word[::] for word in (temp.append(w) if w!="" else 0 for w in song.split("WUB")))
- song="AWUBWUBWUBBWUBWUBWUBC"
- print(song_decoder(song))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement