The solution to the program (because of the problem of numbers) does not respond

Time:2021-8-30

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

Recommended Today

Chapter 45 SQL command from (I)

Chapter 45 SQL command from (I) A select clause that specifies one or more tables to query. outline SELECT … FROM [optimize-option] table-ref [[AS] t-alias][,table-ref [[AS] t-alias]][,…] parameter optimize-optioN – optional – specifies a single keyword or a series of keywords separated by spaces for query optimization options (optimizer tips). The following keywords are supported:%ALLINDEX、%FIRSTTABLE […]