Commit bf26470a by BellCodeEditor

auto save

parent c77c67e6
Showing with 18 additions and 10 deletions
username = "python" bingo_num = 2
userpassword = "123456" num_list = [1,3,5,8,11,15,17,18,20,21]
while True: low = 0
name = input("请输入用户名:") high = len(num_list)-1
password = input("请输入密码:")
if name == username and password == userpassword:
print("登录成功!")
print("用户名和密码错误!请重新输入") while low <= high:
print("欢迎来到贝尔编程!") mid = (low + high) // 2
\ No newline at end of file guess = num_list[mid]
if guess == bingo_num:
print("找到,在",mid)
break
elif guess< bingo_num:
low = mid+1
elif guess< bingo_num:
high = mid-1
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment