Answer the question
In order to leave comments, you need to log in
How would you change the structure of a program in Python based on OOP?
Dear programmers, I'm starting to learn OOP based on Python and I can't figure out how to make my program simpler and more understandable. There is a procedure with a cycle in which a lot of data is iterated and changed.
###
for X1 in obj():
X1 = ModifyValueX1(X1)
Y2 = ModifyValueY1(Y2)
###и т.п.
Answer the question
In order to leave comments, you need to log in
The structure of your program is not at all clear, so it's impossible to say exactly where to shove OOP.
ModifyValueN can be replaced with something like this:
def modify(value, func):
return func(value)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question