IndentationError:应缩进的块。我不知道我在哪里写错了

import random
r = random.randit(1,20)
while(True):
    inp = int(input())
    if(inp < r):
    \\\**print("wrong guess, enter a greater number")**///
    elif(inp > r):
    print("wrong guess, enter a smaller number")
else:
    print("congrats, you have guessed the right number")
    break;
评论
  • 根号四
    根号四 回复

    这不是python代码:D

    import random
    r = random.randint(1, 20)
    while True:
        inp = int(input())
        if inp < r:
            print("wrong guess, enter a greater number")
        elif inp > r:
            print("wrong guess, enter a smaller number")
        else:
            print("congrats, you have guessed the right number")
            break