python

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.

Sum of even Fibonacci numbers

You need to calculate the sum of even Fibonacci numbers that do not exceed 4 million. I saw a pattern that starting from the ... b = 0 i=1 sum=0 while currentFib<4*10**6: currentFib = fib(i*3) i+=1 sum+=currentFib print("\n" + str(sum))

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)

pip install tensorflow error

I use the latest version of python. When installing pip install tensorflow, an error occurs: ERROR: Could not find a versio ... m versions: none) ERROR: No matching distribution found for tensorflow How can I correct this error? Thank you in advance!

Error installing opencv

You need to install opencv on jupyter On my interpreter via pip, I calmly did it. But there are problems with jupyter. conda ... hours searching for information and I start cursing the one the fact that I accidentally came across this article here it is

How to generate a list or array in Python

I have the original random array: np.array([0, 1, 2]). You need to get two rows of numbers (lists or one-dimensional arrays ... _2] Is there a faster way to generate such series of numbers m_1 and m_2 in another way, for example, using list generation?

Fill the array with random numbers in the range (A, B) and determine the number of elements whose second digit is even

Here is the task: Write a program that fills an array of N elements with random integers in the range [ A , B ] and determin ... The program works correctly, but the site does not accept the decision. What can I change to make the program run faster?

Python versions on atom linux(ubuntu/mint)

I have several versions of python. I have linux mint. I use the atom code editor with the atom-python-run extension. I want t ... ion.7. When I run the code from pycharm it shows the path /usr/bin/python3. 7, how do I make the same python version in atom?

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?

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.

I can't install the Python discord module "discord" (pip install discord.py)

The error itself pops up after: C:\Users\Home-PC>pip install discord.py Collecting discord.py Using cached discord.py-1. ... uild yarl multidict ERROR: Could not build wheels for yarl, multidict which use PEP 517 and cannot be installed directly

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.

Python Bubble Sorting

How to sort a two-dimensional array by the 1st element in the array using the bubble sorting algorithm? [[3, 2, 1, 4, 5], [4, 2, 2, 3, 4], [2, 2, 3, 2, 2], [1, 3, 2, 5, 2], [5, 3, 4, 2, 1]]

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?

Setting up PyCharm

How can I configure pycharm so that when inserting plain text, the text does not go beyond the prescribed frame, there is an ... to the right side and manual transfer). (Or, roughly speaking, fix the border and make it impossible to cross it) Thank you.

Python development environment for windows

Tell me a good development environment for python for windows. With autocomplete, highlighting, refactoring tools, and the ab ... ad. Although of course the development environment is still better P.S. just don't throw me a link to this page PythonEditors

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