Problems encountered
I spent half an hour writing a code yesterday, but I didn’t expect that onlyinputStatement. The following is a part of the code:
import random
After running,ifThe following statements are completely invalid.
Solving process
First, I checked all the statements below and found no problems, and python did not report errors.
After that, I went to the QQ group and asked. They said that int () should be added. The modified code is as follows:
import random
I don’t know if there is a problem with my understanding. The operation will report an error.
I gave up, too.
resolvent
I was working on another program and suddenly remembered that I could try putting quotation marks around numbers. I tried and finally succeeded
import random
harvest
I found that some can not be added, such as
if r==1:
r==1Medium1You don’t have to use quotation marks
This work adoptsCC agreement, reprint must indicate the author and the link to this article