current position:Home>In Python, there is something wrong with the program and an error is reported

In Python, there is something wrong with the program and an error is reported

2022-02-03 00:38:53 CSDN Q & A

The phenomenon and background of the problem

Is the code copied and pasted , But the error is reported after pasting it , What's wrong

>>> import random>>>import easygui as eg >>>eg.msgbox(" Welcome to the world of guessing numbers !!!")'OK'>>>eg.msgbox(" Welcome to the world of guessing numbers !!!", ok_button=" continue ")' continue '>>>da = random.randint(1, 100)>>>m = eg.integerbox(msg=" Please input your guess number ", title=" Take a guess ", lowerbound=1, upperbound=100)>>>while True:    if da == m:        eg.msgbox(" That's right , Are you the roundworm in my stomach ?")        eg.msgbox(" hum ! There is no reward for guessing right !")        break    else:        if da > m:            eg.msgbox(" The small , The small ")        else:            eg.msgbox(" big , big ")    m = eg.integerbox(msg=" Please enter the number you guessed again ", title=" Take a guess ", lowerbound=1, upperbound=100)>>>eg.msgbox(" Game over , Don't play !!")
Operation results and error reporting contents

The content of the error report is as follows :
SyntaxError: multiple statements found while compiling a single statement

My solution ideas and tried methods
What I want to achieve



Refer to the answer 1:

To create a new file , Put the code in and run it , Interactive is running a single line of code

img




Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030038517187.html

Random recommended