Skip to content

Commit 781414b

Browse files
committed
added test_skill in bab 7
1 parent c66e82b commit 781414b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Created by github @adnanhf
2+
3+
def seqSearch(alist, item):
4+
pos = 0
5+
found = False
6+
7+
while pos < len(alist) and not found:
8+
if (alist[pos][0]).lower() == item.lower():
9+
found = True
10+
else:
11+
pos += 1
12+
13+
if found:
14+
print('Menu found!\nName : %s, price : Rp%s,00' % (alist[pos][0], alist[pos][1]))
15+
else:
16+
print('Menu not found!')
17+
18+
19+
if __name__ == '__main__':
20+
menu = [['Ayam Goreng', 12000], ['Kol Goreng', 5000], ['Mie', 7000], ['Telor', 5000], ['Pecel Lele', 14000]]
21+
z = input('Input menu you want to know : ')
22+
seqSearch(menu, z)

0 commit comments

Comments
 (0)