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
Problem related code , Do not paste screenshots
>>> 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
Refer to the answer 2：
author[CSDN Q & A],Please bring the original link to reprint, thank you.
The sidebar is recommended
- How can I fix the problem of uploading to idea
- com. fasterxml. jackson. databind. Objectmapper throw exception
- What is the reason and how to solve it
- Preparestatement of javajdbc
- int x=8,y=12,z=14 ; x++,y=z++,z=++x; y=x%z- -; Find the value of XYZ
- Why is this the case when I access the PHP test program under localhost in MacOS?
- Why should this code be int & n instead of int n? In C + +, under what circumstances do you need to be int & n
- The redis session problem runs well locally. As soon as it arrives online, it crazy reports exceptions. It starts to report when it starts. And the function can be used normally
- Research on Professional Course Scheduling Based on nonlinear programming
- The question about C + +: that's it: include 'Einstein h'
guess what you like
Sqlyog failed to import the database. I don't know what to do
The Microsoft edge browser can only enter the address in the address bar and cannot search
Why can't data be saved when text is written in this way?
When the user logs in and out, a socket error is reported when he logs in again
The website editor cannot be right-click pasted and cannot be used
On the problem of multi-threaded ball taking and putting (language Java)
Start the flume script and report an error in the generated log file: agent configuration for 'A1' has no configfilters
What can reflect the professional quality of a yard farmer?
Why is the returned hour, minute and second Nan
Python, C problem - leap year judgment
- SQL. Why not attach it, as shown in the figure
- How does robotjs set automatic rebuild in electronic build
- Python final exam SOS
- I admit that I have degenerated, but I still want to know how to solve Java
- I have encountered several array problems in C + +. I hope the big God can solve the puzzle. It's best to have comments
- Why is it double? don't get it
- C language novice village, high adoption rate
- The usage and law of this function are expected to be explained.
- Let's see what's wrong. My code will output one less country
- Why is the average 0
- The replacement of tab key in hive leads to a problem in the file.
- Now to realize a function, use the El tree component of element UI, select the relevant node, and then copy a new tree with only relevant parent-child nodes below.
- Sqlyog database import failed with the following error. Do you know
- How do two lists compare in the same location
- How to group the following data by film and television, education, music, E-sports and other sectors
- Server socket + Android socket can only send a message once after connecting. The second sending does not respond. You need to reconnect the socket and solve it
- Questions about student information management system C++
- Qtable widget of QT double click to edit and display the problem
- Separate strings and insert a comma for each 5 characters
- QT qtablewidget double click to modify the content. What is the problem
- MySQL reports an error in Navicat. How to solve it?
- Router link cannot jump into router view (Vue)
- Why is the camera preview frame obtained by Android like this
- How to implement JS? The address bar changes the page load and refresh, and the selected conditions of the current page remain unchanged as all by default
- Why did 0.3 become 0.2999999999
- What is the reason for the warning when Vue project is packaged
- Yolov5 deployment final inference report cannot find picture
- How to extract the characters of a paragraph in Notepad?
- Computer network technology IP questions
- MySQL group query gets the data of the first 24 hours in each group
- What's wrong with this and need to be changed?
- Write a program to find the number of integers between 200 and 300 that meet the following conditions. Condition: the product of hundreds, tens and individuals is equal to the sum of hundreds, tens and individuals
- In Python, the condition setting and interpretation of while loop
- How can jupyter notebook run on the next line of code followed by the above code
- The page has been loaded. Press F12 at the top to show it. What's going on
- This CompareTo method is not called. How do you sort the elements in the collection
- Using pointer method: input three integers ABC and output them in order of size
- C ＃ new ADO Net data model, error, failed to load file or assembly
- Input n integers from the keyboard and store them in a pile of arrays. Put all positive numbers in the array in front of the array and negative numbers in the back to output the array
- Why can't the small gourd be installed.