All Questions
13 questions
5
votes
4
answers
2k
views
Automate the boring stuff with python - Character picture grid
Character Picture Grid
Say you have a list of lists where each value in the inner lists is a one-character string, like this:
...
1
vote
1
answer
135
views
Python Tic-Tac-Toe [closed]
I made a very primitive Tic-Tac-Toe using Python and I would like a grade on how well I coded the game. What code was there that could've been simpler or more efficient? And any advice you can give me?...
2
votes
1
answer
388
views
Dice roller - python
I am about to graduate with my Associates degree in Math and will soon go for my bachelors. I've decided with two years of school left its best if I start learning to program. I am starting with ...
4
votes
2
answers
164
views
Breakout clone in pygame
As a guy who started coding a month ago, I would like an honest review of my version of breakout that I created using pygame.
...
2
votes
2
answers
275
views
Python program to get all non unique elements in an array
Given an array of ints as input:
non_unique([1, 2, 3, 1, 3]) returns [1, 3, 1, 3]
non_unique([1, 2, 3, 4, 5]) returns []
non_unique([5, 5, 5, 5, 5]) returns [5,5,5,5,5]
non_unique([10, 9, 10, 10, 9, 8]...
5
votes
1
answer
5k
views
Find if one list is a subsequence of another
So the problem of verifying if a list is a subsequence of another came up in a discussion, and I wrote code that seems to work (I haven't rigorously tested it).
IsSubequence.py
...
5
votes
1
answer
6k
views
(Codewars) Range Extraction
Kata: https://www.codewars.com/kata/range-extraction/python
A format for expressing an ordered list of integers is to use a comma separated list of either
individual integers
or a range ...
8
votes
1
answer
7k
views
Rearrange list by modifying the original list, put even-index values at front
I am relatively new to python and I am still trying to learn the basics of the language. I stumbled upon a question which asks you to rearrange the list by modifying the original. What you are ...
7
votes
3
answers
4k
views
python (optimizing) bubble sort
I saw in Wikipedia (the first under Optimizing bubble sort) a pseudo-code to bubble sort and I implemented it in Python.
I am posting my implementation here because I'm new to Python, and I'm looking ...
3
votes
3
answers
109
views
Generating variables to be named, filled in and operated on the fly in Python
I am very new to Python and trying to refactor my code which is ripe for error.
Currently, I manually name a bunch of arrays:
...
8
votes
4
answers
1k
views
Python Implementation - Conway's Game of Life
This is my implementation of Conway's Game of Life in Python. Now since I am a novice coder, naturally I have some key doubts:
The usage of idioms and code redundancies - Are there any small fragments ...
3
votes
2
answers
307
views
Add two 4-D arrays in Python
I have two arrays, each with shape (1, 51, 150, 207)
I need to add them such that:
...
4
votes
1
answer
3k
views
Lingo game using Python
You guess a word, and if its letter(s) is in the same spot as a hidden word's, you add [] around the letter. If it's in the hidden word, but not in the same spot, you add()).
As of now, I have a ...