str = "abcdefg123456"a = input("请输入一个字母或数字:")num = 0result = -1while num < len(str): if str[num] == a: result = num num += 1print(result)
Q群:592857363