diff options
Diffstat (limited to 'challenge-207/robert-dicicco/python/ch-1.py')
| -rw-r--r-- | challenge-207/robert-dicicco/python/ch-1.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/challenge-207/robert-dicicco/python/ch-1.py b/challenge-207/robert-dicicco/python/ch-1.py new file mode 100644 index 0000000000..850c89b0ce --- /dev/null +++ b/challenge-207/robert-dicicco/python/ch-1.py @@ -0,0 +1,47 @@ +#/usr/bin/env python +''' +-------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-03-06 +Challenge 207 Keyboard Word ( Python ) +-------------------------------------- +''' + +rows = ["qwertyuiop", "asdfghjkl", "zxcvbnm"] +words = ["Hello", "Alaska", "Dad", "Peace"], ["OMG", "Bye"] +flag = 0 + +def CheckLetters(w): + ln = len(w) + for j in range(3): + flag = 0 + for x in range(ln): + if (w[x] in rows[j]): + pass + else: + flag = 1 + if flag == 0 : + print("\t",w) + flag = 0 + +for wds in words: + print("Input: @words = ",wds) + print("Output: ") + ln = len(wds) + for j in range(0,ln): + CheckLetters(wds[j].lower()) + print(" ") + +''' +-------------------------------------- +SAMPLE OUTPUT +python .\KeyboardWord.py +Input: @words = ['Hello', 'Alaska', 'Dad', 'Peace'] +Output: + alaska + dad + +Input: @words = ['OMG', 'Bye'] +Output: + +''' |
