ロボット フレームワークを介して引数を渡しています。引数は文字列です。「デトロイト」。その文字列を「D」、「De」、「Det」、「Detr」、「Detro」、「Detroi」、「Detroit」に分解するコードが必要です。もちろん、「Flint」などの別の文字列が入力された場合、それは 5 つの要素に分解されるだけです。F、Fl、Fli、Flin、Flint。
(疑似コード)
def checkCity (self, x):
(take x which is the string, and make it a list of elements containing the letters as above).
(Then take each element and check it against data provided by the device(using a loop for each iteration)
(Once any of the elements are matched to the data, return another function that acts as a key press)
私は一般的にPython(およびプログラミング)に精通しており、理論を理解していますが、コーディング方法がわかりません。