All Questions
253 questions
7
votes
3
answers
549
views
Team picker command line application
I've made a program for randomly splitting game participants into different teams. The code works and solves the problem. I'm interested in advice on what you'd do differently or better.
...
5
votes
1
answer
128
views
backward induction algorithm computation
Is there a way to significantly speed-up this code?
I'm solving a dynamic programming model using a backward induction algorithm. A crucial step is to calculate the current-period value function (VF), ...
5
votes
6
answers
2k
views
Bubble sort with 10 random numbers
I want to make a bubble sorting algorithm of 10 random (non-repeating) numbers from 0-50. I changed many aspects of it while making it and finally got it to work, but I would like to see if there's ...
15
votes
1
answer
1k
views
Typical password generator in Python
Password generators are extremely popular on CodeReview with beginners to both coding in general and Python in particular, for a number of reasons:
They're (seemingly) easy to implement
They offer an ...
5
votes
2
answers
124
views
Seeded PRNG in JavaScript and Python yielding same results
So I need a PRNG in Python and JavaScript that yields the same results, which is the reason I can't use the built-in methods. It doesn't have to be very good or even cryptographically secure, since it'...
5
votes
2
answers
3k
views
Making a dice game as my first Python project!
I just started my programming lessons in school today and I decided to start learning more at home. This is my first day and I know the basics of if conditions, <...
4
votes
4
answers
1k
views
Lottery Analysis (Python Crash Course, exercise 9-15)
I was working on Python Crash Course, exercise 9-15: 'Lottery Analysis'. It took me a very long time to get it to work. The reason it took that long is I wanted to use my existing class from the ...
3
votes
0
answers
195
views
Truly cryptographically secure password generator in Python, version 2
Following suggestions from answers from my previous question, I have completely rewrote my script, to make it more concise and Pythonic, truly cryptographically secure, and added more functionality.
...
11
votes
3
answers
2k
views
Python command-line program that generates passwords
I took my code from this answer by me, I found it useful, so I developed it further, and here is the result.
This script generates cryptographically secure passwords. The characters used by the ...
10
votes
3
answers
3k
views
Python \ random password generation code
I have written a python program for random password generation and as a newbie I would like my code to be reviewed by professionals and if they have any suggestions to improve it.
...
9
votes
2
answers
903
views
Simulation of hero vs monster
I fairly started coding no more than 2 weeks now; not even for long, and a thread inspired me to make a random back-to-forth game between a Hero and a Monster where it randomly choose a certain number ...
1
vote
1
answer
726
views
Random Name Selection from a "Hat" in Python
Background/context: This program randomly selects predefined items ("Names" as strings) according to 2 rules:
#Rule 1: Each name/item in the list can only be selected once.
#Rule 2: Single ...
1
vote
2
answers
92
views
Create a random list of values with corresponding tokens
I have this code that uses loops and random generators to create a random list of values (operators, strings, integers, floats, and new lines) and a corresponding list of the correct tokens to test a ...
5
votes
1
answer
383
views
blackjack dealer hand generator
I wrote a piece of blackjack code - for dealer dealing cards to himself (python). My question is how can I make it more efficient, faster and neater. I ran it for 1.000.000 iterations and it took 14.7 ...
4
votes
2
answers
1k
views
generate lottery numbers to store in a text file
I scripted a program in python to generate lottery numbers for user. There are two playing methods:
Lotto6aus49: User can choose any 6 numbers out of 49.
Eurojackpot: User can choose 5 numbers out of ...