From a044e92fb6ee65a1c8775109bae8431610628aa1 Mon Sep 17 00:00:00 2001 From: yaser25 Date: Mon, 21 Oct 2024 11:19:49 -0700 Subject: [PATCH] My direction and test --- strings/solve-yaser25.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 strings/solve-yaser25.py diff --git a/strings/solve-yaser25.py b/strings/solve-yaser25.py new file mode 100644 index 0000000..6d5ef0b --- /dev/null +++ b/strings/solve-yaser25.py @@ -0,0 +1,17 @@ +yaser = "Whiskey Hotel Four Tango Dash Alpha Romeo Three Dash Yankee Oscar Uniform Dash Sierra One November Kilo India November Golf Dash Four Bravo Zero Uniform Seven" +'''to separate -yaser-, and Access to the list''' +yas = yaser.split(" ") +#------------------------------------- +num_dic = { + "One": 1, "Two": 2, "Three": 3, "Four": 4, + "Five": 5, "Six": 6, "Seven": 7, "Eight": 8, + "Nine": 9, "Zero": 0, "Dash": '-' +} +#------------------------------------- +'''Use the function to read more''' +def main(): + for i in yas: + print(num_dic.get(i , i[0]), end="") +#------------------------------------- +if __name__ == '__main__': + main()