Python 3 is the latest version of the Python programming language and was formally released on December 3rd, 2008.
3
votes
0answers
20 views
Outstanding password keeper w/ password generator
After almost completely redoing the first version I think I finally have it. I still have a few things to add/change, but I think it's pretty good and safe. I've improved security features as well as ...
6
votes
2answers
42 views
Automatic ping check program
Am I commenting enough? Are my variables properly following correct styling format? Is there a more efficient way to code my "Label coloring" conditions?
...
5
votes
1answer
42 views
Rounds off numbers from 1 - 10, 000 including negatives
I was trying to replicate Python's internal round() function.
The program asks for a number, converts it into a float (catches the value error if present) and gets the absolute value of the float (to ...
5
votes
1answer
50 views
Node, Link, Node, Link, Node: Linking Nodes into a LinkedList
For practice in Python OOP (first time) and for some relaxation from trying to learn Serialization in Java, I decided to write a LinkedList in Python. Now, this class would be pretty useless, because ...
5
votes
3answers
53 views
Simple word shuffling game - follow-up
From my previous question, I got great feedback which helped improve my code which I submitted. I went back and built upon that and came back to see if my code is an improvement.
...
6
votes
3answers
174 views
Ordering an un-ambiguous scrambled date
A date is un-ambiguous when each number may be
decided to be day or month or year given the range
limitation of these numbers.
For example
\$14\$ cannot be a month number
\$2008\$ cannot be ...
16
votes
2answers
588 views
Telling fibonaccis to the user
Though this program tells the truth (unless you change the source code), it does tell Fibonacci numbers, depending on the user's input. Keeping in mind of all (or most) of the feedback given from ...
14
votes
3answers
914 views
Pythons Around the Rose
Based off my Java Petals Around the Rose, I thought it would be good practice to write something again in a different language.
Because the language is Python, I named it "Pythons Around the Rose", ...
3
votes
2answers
51 views
“Time till” program
I have created a program which works out days, hours, minutes, seconds and milliseconds until a date which the user inputs. Is it possible to shorten/make the output a little clearer?
...
7
votes
2answers
61 views
Small turtle program using instruction strings to draw patterns
A while ago, I wrote a program that combined L-systems and turtles. This was before I understood OOP (I still don't fully understand classes, or if they are even needed here). I tried to add some ...
5
votes
2answers
57 views
Finds the winning hand at showdown in texas holdem for an arbitrary number of players
I've read about half of a pretty extensive and popular Python book (I'm a complete beginner) and I decided to get my hands dirty with this little exercise to crystallize all the concepts I've taken ...
6
votes
2answers
122 views
Random File Opener
I wrote a random file opener in Python that takes file extensions as a tuple at code level, and directory/amount at console level:
...
18
votes
3answers
2k views
1, 2, Fizz, 4, Buzz: FizzBuzz
I just recently started working on python (interesting language, actually), and, as I always do when I learn a new language (with the exception of BrainFuck, that's too hard), I write a FizzBuzz ...
6
votes
1answer
23 views
Scraping SEDE query results with caching
I use this script to scrape the results of a SEDE page and return as a BeautifulSoup object.
A small twist is that if I don't use a SEDE query manually in the browser for a few days, then ...
-6
votes
1answer
52 views
Addition script - follow-up
Here is my latest version of my addition script. I have tried to take on all the advice I have been given by people like @Janos and @Hosch250 and also tried to keep to the guidelines set by the PEP8 ...
-1
votes
2answers
58 views
Ten questions maths game
Like my previous question about my Mental Maths game , I have written a script for a ten questions Maths game and again it seems like there is a more simple method, can anyone take me out of the dark ...
4
votes
2answers
283 views
Mental Maths game
I have made a mental Maths game but it seems quite long, is there anyway in which I can simplify it? And can you also help me with my other Maths game, Ten quick questions ?
...
7
votes
1answer
58 views
2 Player Battleship Game
This is an adaption of a single player Battleship game. I made it two player, and I also tried to implement OOP and DRY principles. I would like my code to be reviewed for OOP, DRY, PEP8, and overall ...
5
votes
5answers
256 views
Python High Score Table
I need to be able to store results of a game in a file with names and high scores where I will eventually want to review the file and sort it alphabetically, etc. I'm unsure if I have the correct way ...
6
votes
2answers
33 views
Scraping columns from SEDE results
I use the following script to download the result of a SEDE query and scrape a specific column from it using BeautifulSoup:
...
4
votes
3answers
53 views
NTP Clock on a Raspberry Pi
I've been tinkering around with making a fancy clock on a Raspberry Pi B. This little application will sync the Pi's time with an NTP server, then display it using ...
3
votes
3answers
90 views
Calculator Program which can operate on multiple numbers
All the calculator programs I have seen so far seem long, complicated and they can only operate on two numbers. I am trying to write one that is simple, short, and it can operate on as many numbers as ...
6
votes
2answers
142 views
Simple calculator which can operate on more than two numbers
All the calculator programs I have seen so far seem long, complicated and they can only operate on two numbers. Mine is simple, short, and it can operate on as many numbers as you want. Please tell me ...
4
votes
2answers
125 views
3
votes
4answers
105 views
Determining whether a loop iterated at least one element in generator function
I have a case in which I need to determine whether a for loop yielded at least one element:
...
3
votes
1answer
52 views
Finding all divisors of an integer
The problem is to find all divisors of a given integer n.
(It may be better to implement a true prime generator, rather than a fixed set, as discussed with ...
3
votes
1answer
27 views
Searching the number with the biggest amount of odd divisors in an interval
I wrote this program for school (first year in college) and it works, but it's too slow. I wondered if anyone could help me optimize this a bit, because I've been trying and trying, but it just won't ...
7
votes
4answers
135 views
Goldbach’s Conjecture in Python
Input Format
Input starts with an integer n (1 ≤ n ≤ 100) indicating the number of cases. The following n lines each contain a test case of a single even number x (4 ≤ x ≤ 32000).
Output Format
For ...
5
votes
2answers
47 views
HackerRank: Encryption
Given a two-dimensional list, say some_list = ["ABCD", "EFGH", "IJ"], I am supposed to encrypt it by reading each column top to bottom, thus:
...
6
votes
3answers
61 views
Sorting networks
Yesterday I read a fascinating article on Wikipedia about sorting networks.
Comparator networks are abstract devices built up of a fixed number of "wires" carrying values, and comparator modules ...
6
votes
2answers
567 views
HackerRank: ACM ICPC Team
I made a solution to this problem from HackerRank :
You are given a list of N people who are attending ACM-ICPC World
Finals. Each of them are either well versed in a topic or they are
not. ...
6
votes
5answers
119 views
Regex password strength test
I've been following a Python programming book and reached the Regex chapter where I encountered this challenge:
Write a password strength checker that checks if a password is:
At least 8 ...
1
vote
3answers
94 views
Longest common subsequence (LCS) for multiple strings
How would you improve this code? Particularly the check and check_all functions?
The time complexity of the algorithm of mlcs is \$O(|\Sigma|MN)\$, where \$\Sigma\$ is the alphabet, M is the number ...
9
votes
2answers
164 views
Search for a Pythonic Caesar
I implemented a second encryption algorithm: the well known caesar-cipher. This turned out to be longer than I expected. The "main" code is very concise, but the interface that followed seems a bit ...
5
votes
2answers
53 views
Searching Combobox drop-down list
I've created a Combobox GUI that allows the user to search through the Combobox by entering a letter on the keyboard. If user ...
4
votes
1answer
45 views
A matplotlib scatter function inside a for loop
This function is working exactly as I want, only, it's taking too long.
For speed ups, I've tried to do as much as I can before the main for loop by declaring ...
6
votes
2answers
79 views
Web Scraper in Python
So, this is my first web scraper (or part of it at least) and looking for things that I may have done wrong, or things that could be improved so I can learn from my mistakes.
I made a few short ...
7
votes
4answers
633 views
RPG User File (Stats Holder)
This is my Player file. It is mainly for saving purposes. Is it easy to understand and read? Anything I should add or change for improvements?
...
19
votes
4answers
1k views
Translating from English to Entean
I wrote a python script that converts English to Entean language from an anime called "The Devil is a part timer". I am sloppy at coding and know that the script can be made better.
In the anime, the ...
7
votes
2answers
467 views
Text message “reverser”
I decided to step out of my comfort zone (Java) and try out Python. I wrote a very simple reverser.py and want it to be reviewed.
...
4
votes
4answers
142 views
Mastermind: Evaluating the guess
The evaluate_guess function below returns the evaluation of a guess with respect to Mastermind game rules:
...
2
votes
2answers
51 views
Flashcard memory training
I have written a simple flashcard program that runs in the terminal:
It loads the cards from an ordinary .txt file.
It provides a way to add flashcard from within ...
6
votes
1answer
65 views
Game of Life rules in 14 lines of Python
I've attempted a functional solution to Conway's Game of Life in Python.
The example code allows you to see the next generation of the universe by calling the ...
4
votes
1answer
35 views
Infinite patterned ASCII dice
After seeing Pretty print dice faces from multiple rolls of multi-sided dices,
I decided to make an infinite ASCII dice generator.
There was one requirement, it to follow a normal dice face.
And so I ...
3
votes
2answers
39 views
Text-based Tic Tac Toe with DRY and PEP-8
This is a basic Tic-Tac-Toe game with a minimal interface. The only concessions to ease of use are input validation (7 lines) and 1-indexed rows and columns (a few bytes). I've been trying to tighten ...
2
votes
3answers
52 views
Game in Pythonista App
I've written this Wack-a-mole like game on my iPad in the app Pythonista. Keeping that in mind, it uses a different graphic interface from the one I have usually seen used, Tkinter. I'm a beginner and ...
2
votes
1answer
19 views
Implementing a SQL like structure in Python, changing values
I am implementing a SQL-like datbase system in python, and so I needed to implement a value changing function, but what I ended up with seems very convoluted.
Here is code relevant to the value ...
5
votes
2answers
149 views
Counting e-mails in a mailbox for each hour
Pardon if this is silly, but I'm pretty new to coding. I have this code, that works, but I feel like it could be tighter than this, I just can't seem to get it to work any other way. The idea is to ...
1
vote
2answers
66 views
Breadth-first search: traditional and bidirectional in Python
I have this Python (3.4) script for demonstrating the performance of the BFS algorithm, both traditional and bidirectional:
...
1
vote
3answers
90 views
Age-Calculator Program
This is a code to calculate somebody's age. It takes 2 inputs:
A specific date (to calculate your age at a specific time or the current time).
The birth date.
...