好吧,我想要的是:
[1] [2] [3] [4]
最后我得到:
[[1],[2],[3],[4]]
我做了[i]看看是否可行,但是我真的不知道,请帮忙,我已经发送了完整的代码 你们看看发生了什么,并帮助我确切地将它放在哪里,因为我是一个完整的新手 在python上,我的朋友帮助我编写了代码,但他也不知道
numeroIncorreto = True
continuaProcesso = True
lst_A = []
lst_B = []
while continuaProcesso:
while numeroIncorreto:
try:
n1 = int(input('Digite o primeiro número: '))
n2 = int(input('Digite o segundo número: '))
numeroIncorreto = False
except:
print('Favor digitar um número correto')
numeros = ''
if n2 >= 10 and n2 <= 50 and n1 >= 10 and n1 <= 50:
if n1>n2:
for i in range(n2, n1+1):
if i == n1:
numeros += str(i)
else:
numeros += str(i) + ' '
if i%2 == 0:
lst_A.append([i])
if str(i)[1] == '3' or str(i)[1] == '4': #
lst_B.append([i])
if n1<n2:
numeroD = n2
for i in range(n1, n2+1):
if numeroD == n1:
numeros += str(numeroD)
else:
numeros += str(numeroD) + ' '
if numeroD%2 == 0:
lst_A.append([numeroD])
if str(numeroD)[1] == '3' or str(numeroD)[1] == '4':
lst_B.append([numeroD])
numeroD -= 1
#Visualização na tela com devido espaço
print('\n'+numeros+'')
print('\nlst_A:')
print(lst_A)
print('\nlst_B:')
print(lst_B)
continuaProcesso = False
else:
print('Números fora do intervalo desejado.')
print('Numero 1: ' + str(n1))
print('Numero 2: ' + str(n2))
numeroIncorreto = True
答案 0 :(得分:1)
尝试2020-05-24T01:37:49.746Z - Uncaught internal server error. { MongoNetworkError: failed to connect to server [127.0.0.1:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool.<anonymous> (/opt/bitnami/apps/parse/htdocs/node_modules/mongodb-core/lib/topologies/server.js:564:11)
at emitOne (events.js:116:13)
at Pool.emit (events.js:211:7)
at Connection.<anonymous> (/opt/bitnami/apps/parse/htdocs/node_modules/mongodb-core/lib/connection/pool.js:317:12)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at Connection.emit (events.js:214:7)
at Socket.<anonymous> (/opt/bitnami/apps/parse/htdocs/node_modules/mongodb-core/lib/connection/connection.js:246:50)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
name: 'MongoNetworkError',
errorLabels: [ 'TransientTransactionError' ],
[Symbol(mongoErrorContextSymbol)]: {} } MongoNetworkError: failed to connect to server [127.0.0.1:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool.<anonymous> (/opt/bitnami/apps/parse/htdocs/node_modules/mongodb-core/lib/topologies/server.js:564:11)
at emitOne (events.js:116:13)
at Pool.emit (events.js:211:7)
at Connection.<anonymous> (/opt/bitnami/apps/parse/htdocs/node_modules/mongodb-core/lib/connection/pool.js:317:12)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at Connection.emit (events.js:214:7)
at Socket.<anonymous> (/opt/bitnami/apps/parse/htdocs/node_modules/mongodb-core/lib/connection/connection.js:246:50)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
2020-05-24T01:37:38.156Z - error getting auth for sessionToken
和print(*lst_A)
。
答案 1 :(得分:0)
首先将列表中的元素转换为字符串,然后将其连接为
1) File should have the word "Cat" or "Dog"
2) Column 6 should be TRUE
3) Column 7 should be more than 7
结果
awk -F',' '$5~/Cat/ || $5~/Dog && $6=="TRUE" && $7>=7' cat.csv > catFinal.csv