-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbt dic04.py
More file actions
54 lines (50 loc) · 1.67 KB
/
bt dic04.py
File metadata and controls
54 lines (50 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
mybooks=[
{"Title": "Android App Development", "Author": "Thanh Tran",
"Publisher": "VNU", "Price": "25000","Published_Year": "2017"},
{"Title": "Python", "Author": "Thanh Tran",
"Publisher": "VNU", "Price": "23000", "Published_Year": "2019"},
{"Title": "JavaScript", "Author": "Pham Dieu",
"Publisher": "SSS", "Price": "38000","Published_Year": "2018"},
{"Title": "HTML5", "Author": "Man Nhi",
"Publisher": "HCM", "Price": "33000", "Published_Year": "2012"},
{"Title": "Compiler", "Author": "Thanh Tran",
"Publisher": "VNU", "Price": "24000","Published_Year": "2011"},
{"Title": "C language", "Author": "Man Nhi",
"Publisher": "SSS", "Price": "29000","Published_Year": "2010"},
{"Title": "Programming Linguistics", "Author": "Pham Dieu",
"Publisher": "HCM","Price": "41000", "Published_Year": "2009"},
{"Title": "C# language", "Author": "Thanh Tran",
"Publisher": "VNU", "Price": "42000","Published_Year": "2013"},
{"Title": "App Inventor", "Author": "Man Nhi",
"Publisher": "LD", "Price": "30000","Published_Year": "2015"},
]
check=False
while check==False:
chon=input("""Chọn để tìm kiếm:
1.Title
2.Author
3.Publisher
selec(1,2,3):
""")
if chon=="1":
kwd="Title"
break
elif chon=="2":
kwd="Author"
break
elif chon=="3":
kwd="Publisher"
break
else:
print("inval input")
check=False
dem=0
inputkw=input("Nhâpj keyword để tìm kiếm: ")
for dong in mybooks:
if inputkw==dong[kwd]:
print("Title: ", dong["Title"])
print("Author: ", dong["Author"])
print("Publisher: ",dong["Publisher"])
dem+=1
if dem==0:
print("No found")