Position: Home page » Equipment » Python mining code

Python mining code

Publish: 2021-05-21 06:40:52
1. You can download its source code from the official website of Python
https://www.python.org/downloads/source/
2.

numbers=[]

while True:

n=input()

numbers.append(n)

if len(numbers)==5:

numbers.sort(reversed=False)

print(numbers)

break

3. k=0
while k>= 0:
if 5**(3**k)%2 == 3:
print(k)
break
k += 1
4. Input two numbers, compare the sizes, and then output

def cmpnum():
A = input (& quot; Please enter a number: & quot;)< br />b = input(" Please enter a number: & quot;)< br />if a >= b:
Print (a, b)
else:
Print (B, a)

cmpnum()

result 1:

please enter a number: 159
please enter a number: 456
456 159

result 2:
please enter a number: 9568
please enter a number: 1452
9568 1452
5. include <QtCore/QCoreApplication>
#include <QAxObject>
#include <Windows.h>
int main(int argc, char *argv[])
{
//OleInitialize(0);
//CoInitialize(0);
QCoreApplication a(argc, argv);
QAxObject *asdfg = new QAxObject("Excel.Application");
return a.exec();
}
6.
defgetsubset(myset,subtract):
iflen(myset)<=1:
return[]
result=[]
newsubtract=subtract.()
foriinsubtract:
result.append(myset-{i})
newsubtract=newsubtract-{i}
result.extend(getsubset(myset-{i},newsubtract))
returnresult
defsubset(myset):
result=[set(),myset]ifmysetelse[myset]
result.extend(getsubset(myset,myset))
returnresult
result=subset({'a','b','c','d'})
toprint=[sorted(x)forxinresult]
foriinsorted(toprint,key=lambdax:(len(x),x)):
print(i)

虽然这对我来说的确比较简单,可也不是几分钟就能写出来的,好歹给点分吧

而且(a,b,a,c) 不是集合,集合中元素不应有重复

一个n个元素的集合的所有子集是2的n次方个吗,如是,这个程序应该就是正确的

7.

This one is relatively simple

First of all, we need to know how to judge whether the year is a leap year. This function can judge:

the code is finished. The test passed

8. a= {#39; Language & #39;: 80, & #39; Number & #39;: 90, & #39; English & #39;: 100.5}
sum=0
for key in a:
sum+=a[key]
avg=sum / len(a)
print (" Average achievements: %s " %

9. Innocent and ridiculous
it's a prison sentence to use a crawler to capture the system openly. Even if there is such a code, it is expensive
Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750