Online Compiler Python

num = 5 if int(input("请输入第一次猜想的数字:")) == num: print("恭喜,第一次就猜对了!") elif int(input("猜错了,再猜一次":)) == num: print("猜对了") elif int(input("猜错了,再猜一次:"))== num: print("恭喜,最后一次机会,猜对了") else: print("Sorry,全猜错了,我想的是:5")
The code asks the user to guess a number up to three times, comparing each guess to 5, and prints a message depending on whether the guess matches.

- Look closely at the second input line: the colon inside the string is a full-width character (:) placed outside the quotes, which breaks the syntax. Check that the colon is a normal ASCII colon and sits inside the string.
- Notice that each input is called only when the previous condition is false, so the user is prompted again only after a wrong guess. Think about whether that matches the intended flow of three separate attempts.