Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Add this tag to your question to indicate that you are new to the language of your code. This will often be taken into consideration by reviewers when assessing your code.
5
votes
First attempt: Python Rock Paper Scissors
Just for the record, when I saw the abuse of global arguments above and a ton of Python program level looping just to handle a lot of the game functionality, etc., I immediately thought this could be …
12
votes
Accepted
Beginner's simple calculator
Welcome to the world of beginner Python programming, and programming in general! Python is a nice language to learn and start out with! … This is the code that will do that:
if response == 'q':
break
elif response not in 'asmd':
print('*Unknown input*')
continue
Because you're a beginner, let me break down the elif here. …
4
votes
Accepted
Snake is dead. Long live snake
Glad to see iteration #2 of your code, and that you've used some of my suggestions! :)
Got some more for you though.
Docstrings
While you have comments explaining what different functions seem t …
3
votes
Accepted
Number to Roman Numerals in Python
Welcome to Code Review!
Most of my suggestions are stylistic, but still something to care about in the Python world. (PEP8 Style Guide) I did catch a fairly major bug since you are only accepting 1 …
10
votes
Accepted
Program to accept numbers, then calculate the mean, median, and range
Disclaimer: You asked me to be harsh, so I'm not holding back as much. I tried to though...
Welcome to Code Review! Your python code has been put through my scrutiny and I have some concerns an …
2
votes
Accepted
python3 utility: convert safely to int
I know this question/post is old, but...
Use isinstance rather than directly storing and then checking the type() output.
We can get rid of t and two of your if statements to check type by using i …
8
votes
Accepted
Python! (Snake)
I'm not really the best at reviewing code (I have my own failures in coding too), but I have a few things that I'd like to point out and share.
Consider setting up the new Snake object with an __in …
4
votes
Python sub-process scripts
This suggestion is originally from @ChatterOne, and was initially posted in a comment, and then built upon by me.
You can combine the multiple if statements into one conditional, like follows:
i …
10
votes
Reading a DHT11 to a file
Since this is my idea, I'll share it. (Though, alecxe beat me to the rest of my suggestions)
Use datetime.utcnow().strftime from datetime instead of time.gmtime
As I stated in my comment, I would u …