b728. p013.學籍字典查詢 (Student Info Directory)
Tags : for循環 列表 字典 數列
Accepted rate : 25人/29人 ( 86% ) [非即時]
評分方式:
Tolerant

最近更新 : 2026-07-12 15:44

Content

班長整理了一份同學英文名與座號的字典。輸入一個英文名字,如果能在字典中找到,就輸出其座號;如果找不到,則輸出 Not Found。
字典數據已預設為:{'Tom': 1, 'Jerry': 2, 'Alice': 5, 'Bob': 8, 'Emma': 12}

Input

輸入一個字串,代表要查詢的英文名字。

Output

如果存在,輸出其座號(整數);如果不存在,輸出 Not Found。

Sample Input #1
Alice
Sample Output #1
5
測資資訊:
記憶體限制: 512 MB
公開 測資點#0 (20%): 1.0s , <1K
公開 測資點#1 (20%): 1.0s , <1K
公開 測資點#2 (20%): 1.0s , <1K
公開 測資點#3 (20%): 1.0s , <1K
公開 測資點#4 (20%): 1.0s , <1K
Hint :
所學知識點:字典(Dictionary)查詢、成員運算子 in
Tags:
for循環 列表 字典 數列
出處:
[管理者: ricky@g.puic...(wong ricky) ]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」