>>> # Import the Decimal type from the decimal module
>>> from decimal import Decimal
>>> # Values are represented exactly so no rounding error occurs
>>> Decimal("0.1") + Decimal("0.2") == Decimal("0.3")
True
>>> # By default 28 significant figures are preserved
>>> Decimal(1) / Decimal(7)
Decimal('0.1428571428571428571428571429')
>>> # You can change the significant figures if needed
>>> from decimal import getcontext
>>> getcontext().prec = 6 # Use 6 significant figures
>>> Decimal(1) / Decimal(7)
Decimal('0.142857')
from itertools import permutations
digit = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
#ЛИРИК
#ФИЗИКА
for L,I,R,K in permutations(digit, 4):
if L > 0:
lirik_num = int(str(L)+str(I)+str(R)+str(I)+str(K))
fizika_num = 2*lirik_num
fizika_str = str(fizika_num)
if len(set(fizika_str)) < 5:
continue
if len(fizika_str) == 5:
if '0' in fizika_str:
continue
else:
fizika_str = '0'+fizika_str
if len(set([fizika_str[0], fizika_str[2], fizika_str[5]])) != 3:
continue
if int(fizika_str[1]) != I or int(fizika_str[3]) != I or int(fizika_str[4]) != K:
continue
print (f'{lirik_num} = 0.5*{fizika_num}')
break
import sqlite3
con = sqlite3.connect(r'C:\Users\asus\PycharmProjects\YKR\YKR\reports_db.sqlite')
cur = con.cursor()
line_for_search = '1'
for tablename in cur.execute("select name from sqlite_master where type = 'table'"):
print('SELECT * FROM {} WHERE Line="{}"'.format(tablename[0], line_for_search))