当用户输入键(整数)时如何在字典中显示键(整数)
string = input("Please enter a name> ")
def enumerate_string(string):
s = {}
for i,letter in enumerate(string):
s[i] = letter
x = enumerate_string(string)
string2 = input("enter several integers separated by a comma ")
string3 = string2.split(',')
if string3 in set(x):
print(x[string3])
aluckdog
DIEA
相关分类