3
votes
2answers
77 views

Word counter script

I made a word counter. It works as long as there aren't any lone punctuation marks. How could it be improved? (Could it be made simpler? Are the comments detailed/clear enough? etc.) I know it's ...
4
votes
2answers
105 views

K-means clustering in Python

The following code uses scikit-learn to carry out K-means clustering where \$K = 4\$, on an example related to wine marketing from the book DataSmart. That book uses excel but I wanted to learn Python ...
3
votes
2answers
57 views

Comparing two partition functions in Python

I have written a partition function in Python (my_partition_adv). I have written this one after reading a similar function from a website. The version of the ...
7
votes
2answers
151 views

Python Email Program

I've written this email program in Python, and I would like to get some feedback on it. (i.e. closing the server twice after the raw input, etc.) ...
6
votes
5answers
201 views

Guessing Game in Python

Now that I've got this working, any improvements that I can make to better my code review would be helpful. ...
4
votes
2answers
162 views

Best way to display big data

I would like to display this data, callable at any time, but I'm not sure if this is the best practice to do so. ...
6
votes
3answers
477 views

Streamlined for-loop for comparing two lists

I'm new to Python and I'm wondering is there a way to streamline this clunky code I've written. Maybe a built-in function I've never come across before? I run through two lists of binary numbers and ...
5
votes
1answer
134 views

Fallout-style homework game

I've been going through LPHW (learn Python the hard way) lessons and I am now at exercise No36 where I have to create a similar game. Could you please review it and point out beginner mistakes? ...
5
votes
1answer
94 views

Improving a triangulation test script

I am a relative beginner to Python and as such I've been working on little things here and there in the office that strike me as something interesting that might be fun to try and code a solution. ...
3
votes
2answers
121 views

Text file reading and printing data

MyText.txt This is line 1 This is line 2 Time Taken for writing this# 0 days 0 hrs 1 min 5 sec Nothing Important Sample Text Objective To read the text ...
3
votes
2answers
140 views

CSV email script efficiency

I'm tasked with getting emails from a .csv file and using them to submit a form. I am using the csv and mechanize Python libraries to achieve this. ...
2
votes
3answers
517 views

Simple hashing code with excessive conditional statements

Any thoughts on my code? It's a simple hashing code that runs from the command line. There just appears to be a lot of condition if / ...