python-3.x's questions - English 1answer

2.175 python-3.x questions.

...

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'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 ...

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 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'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. ...

This question is based on my previous question asked here for my code performance and how correct my code. In this section, I have provided my live code which is currently in development: Django ...

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....

Good morning Stackexchange, For begining sorry for my English, its not my strongest point , I'm stuck with my code and have no choice , have to ask someone for help. Will try explain You whats is my ...

...

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 ...

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? ...

I'm pretty new to python, and coding in general. For practice, I've written the following code, which uses Gaussian reduction to solve a system of linear equations. ...

Short intro So, I've been using Django for a while now and thought it would be nice to start a simple application. In an ideal World, each app must have a way of letting its users register and that's ...

I've often wanted an anonymous function that would do more than return the result of an expression. So I developed one around the exec function that supports assignments and multiline lambdas but ...

I wrote code in Python that takes a string s as input and determines the longest substring of s that’s in alphabetical order. In ...

I am implementing a websocket application for live data feed updates to each client according to their watchlist. Here are the requirements: Once user register with my application, he can view list ...

I was Googling for a 'correct' or 'efficient' implementation of the Sieve of Eratosthenes. I found them all more complicated than what I came up with. I am by no means a Python expert, so I was ...

I have spent hours on this code. I am a beginner and open to advice and improvements. I've put # where I feel insecure about the code. It lets you pick your marker,...

I was reading on this page about using a thread, catching an exception, and notifying the calling thread. The answer suggested Queue, but in the comments it states:...

I have a 60gb+ XML file and, as you can see, I am using a Python script to extract the data and execute 'INSERT' statements to update my database. Being that the file is so large, will I run into ...

I've created a crawler using class. This crawler is able to scrape a certain webpage. Total data out there is 249 and the data are displayed there through different pages. I tried to make it ...

I made this utility function to check for parameters. All it does is checking whether a given variable is an int, or a float/str that represent exactly an int (ie. no decimal part or NaN), and casting ...

I would like to search a list of unique values and create a dictionary with those unique values as keys, and a binary list for whether those values occur. I have successfully solved this, but would ...

This question was presented to me, adapted from Project Euler #8. The goal is to find the N adjacent digits in the 1000-digit number that have the greatest product. Range of N: 10 <= N <= 50. ...

Divisors of 42 are : 1, 2, 3, 6, 7, 14, 21, 42. These divisors squared are: 1, 4, 9, 36, 49, 196, 441, 1764. The sum of the squared divisors is 2500 which is 50 * 50, a square! Given two integers ...

I'm designing a new esoteric language, and the interpreter is in Python3. It is going to use Prefix Notation, so as part of the interpreter, I need a function that evaluates a string as prefix ...

I am new to Django and wrote first application as training excercise(a simple file server). All you need to setup application is add local_settings.py under file_server directory with BASE_PATH ...

I have census data that looks like this ...

This code is for the game Hangman, I added a little bonus in it for cheating/debugging reasons, I thought it's worth sharing since it's the biggest code I've created yet. Description: Classic game ...

This program created by me spells a number in the standard notation. (Billions, Millions etc). I was wondering if there is a better way to do the same thing, or if I have been a victim of some of the ...

This is a simple TicTacToe game which allows 2 human players to play together. This involves no AI. I am fairly new to programming and have only been learning python for 20 days. I need to know if ...

My program evaluates fastq files. The fastq file is just a huge text file (about 1,5gb in my case), which looks like this: ...

I have been working on this code for a while and it gave me a lot of headaches before I got it to work. It basically tries to use the MNIST dataset to classify handwritten digits. I am not using the ...

You have been given two strings, A and B (of length N each) and Q queries. The strings contain only 0s and/or 1s. For every query, you are given an index i. You have to update the value at ...

Problem: Using the recursion approach, find a Fibonacci sum without repetition of computation. ...

I'm solving exercise 4 from Discussion 3 of Berkley's CS 61A (2012) (see page 4): Fill in the definition of cartesian_product. ...

As this is pure Python so using loop with big files make the code very slow any improvements or suggestions. Hide Code ...

Python 3.6.5 Is there any better solution than this one? Particularly the last line. I don't like it. ...

Project Euler Problem #1 Description: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all ...

I wanted to make use of the speedtest-cli while also incorporating pandas into the project. My initial goal, which I am posting here, was to take the values of the speed test and incorporate them into ...

My code is determining the difference between two iterables in terms of items that have been addded, removed and kept. The items are assumed to be sortable and there are no duplicates. ...

Related tags

Hot questions

Language

Popular Tags