All Questions
148 questions
1
vote
1
answer
149
views
Register/Login for Rock/Paper/Scissors
Recently I have been learning Python after years of putting it off, and I am having a really fun time with it. However after I spent a few hours making something that I thought was pretty cool, I ...
3
votes
4
answers
2k
views
Find differences between two directories
Coming from another language than Python, I would like to see if my code is "pythonic" enough and follows good practices.
It compares two directories, showing all files that are in one and ...
8
votes
2
answers
3k
views
log setup using RotatingFileHandler and basicConfig
I am new to python, and developing a moderate application for which I need to setup a logging mechanism.
The below program sets up log handling, which gives the user an option to specify whether log ...
3
votes
1
answer
66
views
Interactive, real-time bikeshare web application with Bokeh
As a side project, I'm working on a Bokeh web application to display public bikeshare data on a map. The data is updated every 2 minutes using a periodic callback. Below is the full implementation.
I'...
2
votes
1
answer
190
views
LeetCode 839: Similar String Groups III
I'm posting my code for a LeetCode problem. If you'd like to review, please do so. Thank you!
Problem
Two strings X and Y are similar if we can swap two letters (in different positions) of X, so that ...
4
votes
2
answers
362
views
Print a pattern of text based on a line from an Excel file
I started to learn Python not long ago to automate certain tasks I work on. I want to optimize a script I wrote that takes a line in an Excel file and prints a pattern of text based on this line's ...
7
votes
3
answers
2k
views
Guttag's Finger Exercises: Enter 10 integers, find largest odd integer and print result
I'm making my way through the Intro to Computation and Programming test by John Guttag and he gives these small exercises to practice gearing up into computational thinking. As of Ch.2, we've covered ...
3
votes
1
answer
186
views
First python program: basic calculator
I want to start learning python for fun and so I could dig into machine learning projects later in the future maybe.
I started off with a small calculator project just to get the hang of the language ...
3
votes
3
answers
329
views
Free time calculator
I started learning Python 2 about a week ago, using Codecademy and Stack Overflow answers to help me learn. I wrote a code to calculate the user's free time based on user sleep and work time. It also ...
4
votes
2
answers
2k
views
Guess-the-number game by a Python beginner
For some background I'm pretty much a beginner and attempting to learn Python currently. So I decided after a few days of lessons I'd look for some beginner projects to test my knowledge. A website ...
3
votes
0
answers
320
views
OLED display application for Raspberry Pi
Python script to output status information to a small OLED screen connected to a Raspberry Pi.
I'm relatively new at writing python so although the app works and outputs correct information it is far ...
7
votes
1
answer
425
views
Printing factors and prime factors of a number
I wish that someone could review my code and find faults with my style and weak areas, so that I might work upon it.
...
3
votes
2
answers
2k
views
Python 2.7 Powerball Game
This game allows one to either pick their own lottery numbers or have them generated and checks them with the most recent numbers, jackpot, and multiplier. I use concepts such as ...
3
votes
1
answer
791
views
Noughts and crosses game for 2 players
This is my first program in Python that I have coded and I am relatively happy with how it turned out. I would like to know how I could make my code shorter and more efficient.
...
1
vote
1
answer
2k
views
Looping through a tree to get branch or leaf
This is my solution to a problem from MIT's 6.034 Artificial Intelligence course (see the heading Tree reference on 6.034 Artificial Intelligence, Lab 0). Can you please help me improve my solution (...