python-3.x

What data structures do standard python containers use?

Where can I find out what data structures are represented by containers: string, list, tuple, set, dict or what asymptotics d ... is working with a large amount of data and knowing which operations are expensive and which are not is quite useful to know.

Calculating a list of Fibonacci numbers by recursion

Using recursion, I calculate the Fibonacci numbers. I want to return a list of Fibonacci numbers of length n, but I get an e ... .append(fib(n-1) + fib(n-2)) return s I don't understand why this is happening. Thank you in advance for your help.

Count the number of numbers in a given range whose cube ends in 4 or 9

Number of numbers The program is fed two integers a and b (a≤b) as input. Write a program that counts the number of numbers i ... counter = counter + 1 print(counter) else: i % 10 == 9 counter = counter + 1 print(counter)

Rounding a python number

In the output file, you need to output a real number rounded to the nth decimal place. How do I do this?

ImportError: DLL load failed: The specified module was not found. Will not see cv2

The program uses cv2, I work in conda. Recently, everything worked fine, but then this error began to occur. I recently start ... ort module = self._system_import(name, *args, **kwargs) ImportError: DLL load failed: Not found the specified module. '''

How do I get or track who clicked on a reaction in a message? Discord bot

There is a discord bot. You need to create reactions under the messages that the bot sends, and get information about who clicked on which reaction.

I can't install the Python module 'Discord'

I'll do my best. I immediately apologize for the name of the computer, so it turned out: / The error itself pops up after ... 1\AppData\Local\Temp\tmprxncial_' Check the logs for full command output. Python version 3.8.0 64-bit. The system is 64-bit.

DLL load failed: The specified module was not found. Python

Python 3.7.7 64 Bit. Windows 10 64 Bit Installed the module Vosk using pip install https://github.com/dtreskunov/tiny-kaldi/ ... import _vosk ImportError: DLL load failed: Не найден указанный модуль. Although the folder site-packages has a folder vosk

I can't install the Python module " Pygame"

C:\Users\mapk0>pip install pygame Collecting pygame Using cached https://files.pythonhosted.org/packages/0f/9c/78626be04 ... ------------ ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Multi-page site parsing

import requests import csv from bs4 import BeautifulSoup as bs # URL STEAMTP: https://steamcommunity.com/market/search?appi ... ments\WebProject\trade> As you can see, the parser parses 1 page 3 times. And you need to parse 1 page 2 page and 3 page.

Dictionary slices in Python

Is it possible to somehow take dictionary slices in python? There is a very large dictionary, from which I want to take, say, ... appears, as I understand it, due to the fact that the dictionary elements are taken by the key. How can I solve this problem?

List index out of range error when parsing the site

This code is available: import requests from bs4 import BeautifulSoup as BS r = requests.get('https://www.pointercrate.com/d ... itle[0].text) In theory, the code should return the list of the top, but in the end I get the error list index out of range

Python. Finding a short path in a graph

Let's say there is a graph. As a result, I write it down in the dictionary and it comes out like this, for example: {0: {1, 3 ... not in path: newpath = find_path(graph, node, end, path) if newpath: return newpath return None

Development of Discord bots on discord.py

I'm writing a function that changes the channel name when someone leaves or comes to the server. It outputs the number of ser ... ков: {}".format(len(member.guild.members)) ) What is the problem? Maybe this is because my computer is slowing down?

Python JSON parse all data by the views key

Wikipedia Statistics How to get a list of all "views", numbers like: 16944,15420....

How to get the full path to a file with multiple python os attachments

There is a folder structure: главная папка ----вложенная папка --------третьего уровня ------------файл ------------файл --- ... h.dirname(i) # Не отрабатывает In general, it is not possible to get the parent folder of the destination files in any way

Output of a TIME string from sql in python

Trying to output a table via python def verification(): connection = DataBase.getConnection_log() try: ... | time | YES | | NULL | | +--------------------+--------------+------+-----+---------+-------+

Python's return function

Hello everyone I have a code that runs over a range of strings, while throwing out None. If you don't use return and def, the ... e function into the "global" code, i.e. outside of it? Thank you all in advance! P.S. It is also necessary to filter out None

Search for an item in the list

Code: users = [12390312, 12313123, 57289234, 21837129398] userstats = 21837129398 print("Начинаю поиск") for element in us ... to do, I tried Googling, but I didn't google anything. I'm still new to this field, maybe I don't know something, tell me :)

How do I run a python script using xp cmdshell from sql-server?

Python 3.8.5 is installed on the server. If you run the file bot.py from the command line, then everything works. But I need ... TEWAY\MSSQL_TELEGRAM -d Problem -i C:\Python\Telegram\bot.py' The same mistake. How do I run this one script without errors?