python's questions - English 1answer

8.467 python questions.

I am solving interview question from here. Problem : Given a set of digits (A) in sorted order, find how many numbers of length B are possible whose value is less than number C. Constraints: 1 ...

I have a tree structure where at every node there is a list of documents (document length can vary from 5 to 500), and each document contains a number of words. I want to calculate relative frequency ...

...

I am trying to solve a problem to check whether a given number N is a power of k. Example: Input 9, 3 > True // 3**2 = 9 Input 10, 2 > False Input 4096, 16 > True // 16**3 = 4096 I want to know ...

Suppose I have a collection of items, each of which can have up to N labels. I am trying to come with an efficient algorithm to obtain ...

I have updated my code from the last time it got reviewed. If anyone has some more suggestions on how I can improve this and/or make it faster it would be appreciated! ...

I've written a script in Python using rotation of proxies which is able to fetch different titles from a website traversing different pages. I've tried to write this scraper in such a way so that it ...

This program is an implementation of the Blackjack which is similar to what is played in the casinos. Here were the requirements: I needed to create a simple text-based BlackJack game The game needs ...

After posting here before, reading that advice, and doing some research, I re-planned and started over. The first thing I did was to create a map so I could see what I had to code for. https://sta....

For a game I am writing in Python 3.6.5, I made a text-based animation to indicate the passage of time (when chopping a tree or mining a rock, etc). I did a lot of trial and error to get the output ...

I am learning Python and I tried to do a program to find K points from a set of N points, farthest as much as possible (I'm not ...

I've got some time-series data. I want to examine the weekly and daily variation of that data. For weekly data I can make a plot like this, with the days along the horizontal axis: For daily data I ...

Any efficient way to solve the following problem assuming data is large. I solved the problem but how can I improve the code, which will make it efficient. any suggestions? Data: ...

I've made a game of life in pygame. I need it to get it to run as fast as possible. I've done everything I can think of. ...

I have two lists: actual_result : ...

I have implemented a genetic algorithm in python 3 for a programming assignment, and I think all the logic is correct. A friend of mine has also implemented one which carries out similar logic, ...

I have written a function that takes two pyspark dataframes and creates a diff in line. I am struggling to get it to scale with 100s of columns. I get around the for...

I am writing a simple social media application in Django. I would like to know whether the following model structure is correct, or how can I improve the schema to get better performance. Do I need to ...

Project Euler Problem #12 The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would ...

I have a dataset of around 200,000 tweets. I am running a classification task on them. Dataset has two columns - class label and the tweet text. In the preprocessing step I am passing the dataset ...

Submit tasks to a scheduler, allowing them to be run at a future time. Tasks can be submitted in any order, and non-running tasks can be cancelled. I used a min-heap to prioritize the next task, and ...

I get list JSON text from a webservice and list_of_columns is predefined, I need the output in that format. I am not sure about few things which are as follows I ...

I decided to implement some data structures- this time an AVL tree. I think the logic is correct. Is there a way to make it clearer and do you have any ideas about more tests to add? ...

I'm new to Python and I'd like some feedback on my proposed solution to the following (interview) question. Given a binary search tree with non-negative values, find the minimum absolute ...

I am a beginner in Django and would like some advice regarding best practices. I have the following model: ...

I would like to learn how to create a bot to help me manage my multiple telegram pages. I am looking for the bot to answer frequently asked questions.

This is more of a request than a question, but I hope you guys wouldn't mind checking my code. I've just started out learning Python and attempted a lil project in a simple number guessing game. I saw ...

I've been working on a text-based RPG for a while now on-and-off. After a long hiatus, I've come back to the project. My goal as of right now is to port the game from it's current Print-output ...

I began to program the standard version of Monopoly so that it could be played only using the console. I did this to practice Object Oriented Programming and have little to no background experience ...

I'm looking for some feedback on my code for the collatz function exercise in the Python book Automate the Boring Stuff. It works, but doesn't feel very elegant to me. Is there a better way to ...

I would like to get a few tips on how to improve this program, which is supposed to help recovering lost passwords from .zip files. ...

I am solving interview questions from here. Problem : Given an array A of integers, find the maximum of j - i subjected to the constraint of A[i] <= A[j]. Example : A = [3 5 4 2] Output :...

Purpose of the question: learn more about ways to implement concurrency in Python / experimenting. Context: I want to count all of the words in all of the files that match a particular pattern. The ...

This is my first program. Its a two player noughts and crosses game. I would really appreciate any comments on how to improve my code or make it more efficient. Many Thanks. It is written in Python 3....

Here is a short version! ...

...

I am working with some Java code. Basically I have a wrapper class that holds a string and implements some of the many useful python string methods in Java. My goal here is to implement the Python ...

This is a python program that automates skipping through users on a chat website called talkwithstrangers using the Selenium Webdriver and BeautifulSoup modules of Python. The first part uses ...

This for-loop is the biggest bottleneck in my project, and I'm curious whether there is an opportunity to speed it up by improving the grammar or by using a ...

I asked for assistance creating a Python Lambda function capable of assignments and multi-line lambdas in this post. Following @l0b0's suggestions, I realized that it was better constructed as a ...

I have to define a lot of values for a Python library, each of which will represent a statistical distribution (like the Normal distribution or Uniform distribution). They will contain describing ...

I'm developing an application that will hide information inside the quantization tables of JPEG files. It's called DQTsteg, if you want to know more about what I'm attempting to do. Right now I'm ...

This checks surrounding pixels to my object's pixel: ...

Version 2 of A translator class in Python Changes: Style compliant to PEP8 Both orig_str and filename allowed to be any object ...

This class can be used to access the Google Translate web interface and get translation result for large text (split up into sentences). The Signal class is copied ...

I am doing some pixel operations in Python, which obviously uses a lot of processing power and makes the program extremely slow. I have these nested loops: ...

I have this code to translate text using the Google Translate mobile site. Currently, text size is limited by the request method. Everything else seems to works just fine. I am also about to post ...

Below is a Python implementation of the quicksort algorithm using parallelism. It takes about 1 second per every 10 items in the list, which is hilariously unacceptable. Why is it so slow? ...

The goal: Create an application which manages an inventory of products. Create a product class which has a price, id, and quantity on hand. Then create an inventory class which keeps track of ...

I'm currently implementing data structures and algorithms I studed in my college course. This is my implementation of a singly linked list and a stack. I would appreciate some feedback in terms of the ...

Related tags

Hot questions

Language

Popular Tags