# coding=utf-8
# talk is cheap show me the code show me the code
""" 1、 The user enters a short English sentence 2、 Split string 3、 Loop processing 4、 Inquire about """
# The user enters a short English sentence
msg = input(" Please enter the English characters you want to split ")
msg_list = msg.split() # Default space division
# Declaration Dictionary
dict_count = {
}
# print(msg_list)
# 3、 Loop processing
for m in msg_list:
# Save to dictionary
if m not in dict_count:
dict_count[m] = 1 # Words as our key,1 treat as value
else:
dict_count[m] += 1
# print(dict_count)
code = input(" Please enter the number of words to query :")
print("{} The number of occurrences of this word is : {} Time ".format(code, dict_count.get(code,0)))
# get Inside view code, without code, Default return 0
The content source :https://www.bilibili.com/video/BV1qh411W7HP?p=37&spm_id_from=pageDriver, If offended , Please let me know in time !Thanks*(・ω・)ノ
notes :2021/10/29
be based on Python pygame Foot
Put the folder 2010,2011,label