Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
357 views

Garden simulator [closed]

I tried to write the program so that it runs without error but I want to improve the program so that it follows the Single Responsibility Principle. What changes can I make to improve this program? I ...
bambam's user avatar
  • 21
8 votes
3 answers
544 views

Story-based adventure with functions and relationships

This is a story-based adventure program I coded by myself (forgive the length). It took a long time but it was fun. It includes loading times, changes in relationships, relationship levels, storyline ...
notak's user avatar
  • 605
3 votes
0 answers
116 views

Naive Implementation of A Least Recently Used (LRU) Cache Memoiser

I wrote code to (naively) perform lru memoisation. I tried to write it in a functional programming style, and so did not make use of any global variables. My Code ...
Tobi Alafin's user avatar
  • 1,792
1 vote
1 answer
39 views

Naive Implementation of Automatic Memoisation

I wrote code to (naively) perform automatic memoisation. I tried to write it in a functional programming style, and so did not make use of any global variables. My Code ...
Tobi Alafin's user avatar
  • 1,792
2 votes
1 answer
77 views

Update the idx values if vals element match between consecutive rows

I want to update the numbers in idx field if there is any matching letter between the vals from two consecutive row. ...
everestial's user avatar
2 votes
1 answer
391 views

First-class objects in Python

As a beginner, in order to cement my knowledge of functions in Python, I’ve prepared this Jupyter notebook First-Class Functions. The code in it is working, but before moving on to closures and ...
SKN's user avatar
  • 498
5 votes
3 answers
2k views

Functional Pascal triangle in Python (working version)

This is actually a follow-up question of Yet another Pascal triangle in Python written in functional programming pattern, which is put on hold for posting broken code. Again, this is my ...
nalzok's user avatar
  • 503
5 votes
1 answer
621 views

Yet another Pascal triangle in Python written in functional programming pattern [closed]

Here is my implementation of a Pascal program, which is used to print an n-order Pascal triangle. This is actually an exercise I came up with to familiarize myself with Python's Functional Programming ...
nalzok's user avatar
  • 503
7 votes
2 answers
854 views

Recursive higher-order function

I have implemented a through function for myself in a project. Since I am still quite new in python and want to learn it correctly, I would be happy about any ...
mcocdawc's user avatar
  • 974
4 votes
1 answer
1k views

WAKE UP! CodingBat alarm clock

I'm brand new at Python, but I've been working in general at granulating my functions and being as self-readable as possible without suffering readability. This CodingBat question is a little ...
BrainFRZ's user avatar
  • 841
1 vote
0 answers
735 views

Generic decorator VS generic decorators' decorator [closed]

Here is my little snippet: ...
nalzok's user avatar
  • 503
6 votes
3 answers
976 views

Printing inputted, largest, odd integer

The program asks the user to input 10 integers, and then prints the largest odd number that was entered. If no odd number was entered, it prints a message to that effect. ...
Jared's user avatar
  • 63
36 votes
5 answers
4k views

Sorting strings by length - functional Python

I'm trying to port this little F# snippet while staying pythonic: ...
Mauricio Scheffer's user avatar