diff options
| author | David Ferrone <zapwai@gmail.com> | 2024-09-02 12:36:30 -0400 |
|---|---|---|
| committer | David Ferrone <zapwai@gmail.com> | 2024-09-02 12:36:30 -0400 |
| commit | a144bedd098858190c4b504282b667e7cbc0a37c (patch) | |
| tree | 5cc3ecadd2d9cd04f3ce2724ddeea68c935fcdce /challenge-285/zapwai/python/ch-1.py | |
| parent | a92117f754a875572d11900c871014386b7ade27 (diff) | |
| download | perlweeklychallenge-club-a144bedd098858190c4b504282b667e7cbc0a37c.tar.gz perlweeklychallenge-club-a144bedd098858190c4b504282b667e7cbc0a37c.tar.bz2 perlweeklychallenge-club-a144bedd098858190c4b504282b667e7cbc0a37c.zip | |
Week 285
Diffstat (limited to 'challenge-285/zapwai/python/ch-1.py')
| -rw-r--r-- | challenge-285/zapwai/python/ch-1.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/challenge-285/zapwai/python/ch-1.py b/challenge-285/zapwai/python/ch-1.py new file mode 100644 index 0000000000..5722662b84 --- /dev/null +++ b/challenge-285/zapwai/python/ch-1.py @@ -0,0 +1,27 @@ +def proc(routes) : + print("Input: ") + for l in range(len(routes)): + print(" ",routes[l]) + inlist = [] + outlist = [] + for j in routes: + inlist.append(j[0]) + outlist.append(j[1]) + + ans = "a" + for needle in outlist : + found = 0 + for hay in inlist: + if needle == hay : + found = 1 + break + + if found == 0 : + ans = needle + + print("Output:", ans) + +routes = [["B","C"], ["D","B"], ["C","A"]] +proc(routes) +routes = [["A","Z"]] +proc(routes) |
