python-3.x
How do I find the most frequently repeated word in the text?
Write a program that reads text from a file (there can be more than one line in the file) and outputs the most frequent word ... count[i] == max_word_count:
if word[i] < min_word:
min_word = word[i]
print(min_word,max_word_count)
How do I make a formatted list output?
I can't understand one mistake:
TypeError: can only concatenate list (not "str") to list
There is a line in which various i ... ), tuple([]), but then I get this answer:
['123', '456'] and 789.
I need a result like this, but without [] these brackets.
Python how many days,minutes,seconds left from date to date
I have two dates: current and new year's.
It is clear that using the datetime module in Python 3 , you can subtract these da ... of time until the new year in seconds, days, minutes, hours, etc.
Example:
До нового года: 60 дней 22 часа 45 мин 12 сек.
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.
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 :)
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 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)
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)
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()
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')
Problem with entering an array
The code is not compiled. I can't understand why the error occurs.
Problem with line 6:
spisok[i] = input()
IndexError ... KolStud= int(input())
for i in range(KolStud):
print('Введите ФИО['+str(i)+']: ')
spisok[i] = input()
print(spisok)
Not parsed lurkmore.to
I wanted to parse the site https://lurkmore.to, however, neither the use of the user agent nor the proxy does not help, the e ... aborted.', ConnectionResetError(10054, 'Удаленный хост принудительно разорвал существующее подключение', None, 10054, None))
How do I clear a file of HTML tags and output only text?
You need to clear the file of HTML tags and display the "clean" text.
I can output all HTML codes from the text, but I don't ... trip()
line = line.decode('utf-8')
urls = ''.join(re.findall(r'<[^>]+>', line))
print(urls)
How do I delete the first character in a string with replace()?
The function replace() takes the following arguments in my case:
str.replace(old, new), where old is the element in the strin ... i", and still replaces all the "i".
It is allowed to use other functions, but I would like it with replace(), is it possible?
Using yield in python generator functions
I have met such a variant of writing in generator functions:
def gen(val):
return (yield val)
How does this differ from this option:
def gen(val):
yield val
Why do I need to additionally write "return"?
In the telegram bot when sending a file(photo) the bot flips the photo
First, here is the Bot code
@bot.message_handler(content_types=['document'])
def get_docs(message):
file_info = bot.get_f ... )
I tried to change the format to .png (it didn't help)
I also tried to convert via Pillow, then save it too (it didn't help)
How to remove the distance between blocks in QGridLayout when Fixed / maximum size of widgets?
If you try to limit the size of the widget, then only the horizontal space disappears when spacing=0, is it possible to remov ... dgets.QVBoxLayout(widget)
mainbox.addLayout(gridbox)
self.setCentralWidget(widget)
self.setMinimumSize(500, 500)
How to extract text из.doc a file?
You need to extract the text from the. doc file. How and with what library can I perform this task?
How to hide a link in a word in python 3 telegram bot
Hello everyone
I want to say right away that I am new to Python and at first glance I came across an elementary thing.
To th ... ll lead to telegra.ph another on the mirror tgraph.io.
How do I implement this in code?
Thank you in advance for your answer!