From c14fb99335cd4c88c1cddaee1bc7358046fa1cc7 Mon Sep 17 00:00:00 2001 From: Satida Ruengsurat <92293177+lightblueMochi@users.noreply.github.com> Date: Mon, 18 Oct 2021 19:34:00 +0700 Subject: [PATCH] Create happy_birthday.py --- examples/happy_birthday.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 examples/happy_birthday.py diff --git a/examples/happy_birthday.py b/examples/happy_birthday.py new file mode 100644 index 0000000..efdf7f0 --- /dev/null +++ b/examples/happy_birthday.py @@ -0,0 +1,20 @@ +alphabet = ["x","y","z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] + +all_new_spell = [] +new_sent = [] + +sentence = "kdssb eluwkgdb" +word = sentence.split() + +for i in word: + spell = i.split() + for s in i: + if s in alphabet: + new_spell = alphabet[alphabet.index(s,3,29)-3] + all_new_spell.append(new_spell) + new_word = "".join(all_new_spell) + new_sent.append(new_word) + all_new_spell.clear() + +final_sent = " ".join(new_sent) +print(final_sent)