python

Python: You need to add an item to the list like the insert function, without using the standard language tools

I will immediately make a reservation that I understand that it would not be worth using a snake for such purposes, but I som ... There is no code, because the very beginning of this algorithm (apparently) is the problem. I hope you will have suggestions.

Error when migrating python django

TypeError: init() missing 1 required positional argument: 'on_delete' This error occurs during migration. status = models.ForeignKey(Status) Code that seems to be causing problems. How to fix it?

Data from the socialblade site is not parsed

The data I want to parse: My code: import requests from bs4 import BeautifulSoup headers = { 'User-Agent': 'Mozilla ... e': 'float: right; width: 900px;'}) print(href_youtubers) Problem: The parser outputs an empty list Thank you in advance :)

Sorting a list of Python tuples

You need to sort the list of tuples by lexicographic order (alphabetically), but taking into account the 2nd parameter. Ther ... you I understand that something should be used like sort where i[1] == and so on, but something is not coming up. Thanks.

Convert the date to a string format with the number of days

The DataFrame has a column with values in the following format: 507 days 00:00:00. I need the output to have a value of just 507. I came across .strftime(), but how to apply it here is not very clear.

I can't fix the code for the task on stepik.org

The task sounds like this:"Write a function modify_list (l), which takes as input a list of integers, removes all odd values ... e number [6]. Comrades, could you please help me, a silly novice programmer, can you tell me how to solve this embarrassment?

How to put an f-string in a list

In the process, it became necessary to create a list of templates Example: colorpatterns = ['000000', '{}0000', '00{}00', '00 ... urns out to be empty. Tell me how to get a template when accessing a list by index, and then apply the method to it .format()

How do I remove an item from the list without adding the items to the new list?

How do I remove an item from the names list without adding the items to the new list? When deleting via remove, the length of ... two_cards = 0 if two_cards > 0: w_names.append(names[i]) list1.append(two_cards)

Find adjacent nested lists in the list and merge them into a new list

Help me figure it out. There is a main list with nested lists: a = [[1, 6], [5, 10], [6, 7], [9, 10]] You need to compare ... or the presence of a common element and get a new list in the format: b = [[1, 6, 7], [5, 9, 10]] Thank you for your help.

QIWI Python reference

Good afternoon, everyone. How do you spend the May holidays? I'm making a bot for telegrams in Python, there was a question a ... ber (I understand the phone number is also indicated by the link). How do I make such a link? Thank you very much in advance!

Loop through the list

There is a list with this structure: [('Броня', [2, 0.6747547826210327])] How can you loop through it, but at the same time, ... by type data[0], #Броня data[1] #[2, 0.6747547826210327] My attempt was not successful, it goes through each one separately.

Dynamic forms on django

I am creating a web application for my hand-to-hand combat club and am developing for the first time in Django. I have mode ... d my problem because this is the first time I am addressing problems on the forum. I will be grateful to those who will help.

Task with e-olymp

How to find the number of solutions in a diamond equation with 3 unknowns when given a, b, c, d. Time limit: 0.1 c Memory lim ... nge(1, c+1): for z in range(1, c+1): if a*x + b*y + 0.5*z == c: count += 1 print(count)

How to create a browser extension in Python. Is this even possible?

I had a brilliant idea-to make notes in the form of an extension for Chrome. I have only knowledge of Python, CSS and HTML. Are there any libraries for this in Python?

How to send integers from the client to the server.Python socket

Who rummages in the client-server in python, the socket library help to solve the problem please. SERVER TASK: Create a serv ... reading goes to bytes. When the client server starts, 10 fives are returned With the "stop" command, everything worked out .

copying files to python

I need to copy all the files that have the letter "f" in the name from the entire system to a separate folder there is the be ... res = os.mkdir(save_dir) if res == OSError: print("cant create directory") shutil.copyfile()

How can I make a two-dimensional array from a one-dimensional array?

I have an array: b = ['Hi!', 'My name is Ivan.', 'I am beginner programier...'] I want to make this one out of it: b = [['Hi!'], ['My name is Ivan.'], ['I am beginner programier...']] That is, an array, where each element is an array.

Symmetric difference of sets

Symmetric difference of sets Implement a binary operation on sets - the symmetric difference. Its result is those elements of ... error in the check. It seems that the example performs, but the test does not pass. However, I do not use variables a and b.

How do I close an instance of explorer using Python?

Every time I sit down to learn Python, I open a certain number of programs and files that I will need during training, and it ... s os.system('taskkill /pid ShareX.exe') os.system('taskkill /pid PDFXCview.exe') os.system('taskkill /pid notepad++.exe')

Python VK API how do I get an image from a user and then send it to them?

I started to understand python, I try various functions of the vk-api. Now the bot accepts any message and sends only a certa ... msg = event.text.lower() id = event.user_id sender(msg) send_photo('url картинки')