I am trying to get the concepts of imperative vs declarative styles through python.
From my understanding the definitions of imperative and declarative are
imperative - code all the steps in the desired outcome
declarative - code the desired outcome without the steps
For example:
would this be considered imperative?
L = []
for i in range(5):
L.append(i*2)
and would this version be considered declarative?
L = list(map(lambda x: x*2, range(5)))