How does local assignment make complex expressions easier to understand?
Answer
by assigning names to intermediate quantities.
Tags
#python #sicp
Question
How does local assignment make complex expressions easier to understand?
Answer
?
Tags
#python #sicp
Question
How does local assignment make complex expressions easier to understand?
Answer
by assigning names to intermediate quantities.
If you want to change selection, open original toplevel document below and click on "Move attachment"
Parent (intermediate) annotation
Open it ssignment hasn't increased the expressive power of our function
definitions. It will do so, when combined with other control statements. In
addition, local assignment also plays a critical role in clarifying the meaning
of complex expressions <span>by assigning names to intermediate quantities.<span><body><html>
Original toplevel document
1.5 Control ence function could be written as a single
expression, as shown below, but the return expression is more complex.
>>> def percent_difference(x, y):
return 100 * abs(x-y) / x
>>> percent_difference(40, 50)
25.0
<span>So far, local assignment hasn't increased the expressive power of our function
definitions. It will do so, when combined with other control statements. In
addition, local assignment also plays a critical role in clarifying the meaning
of complex expressions by assigning names to intermediate quantities.
1.5.4 Conditional Statements
Video:
Show
Hide Python has a built-in function for computing absolute values.
>>> abs(-2)
2
We would like to be able to implement
Summary
status
not learned
measured difficulty
37% [default]
last interval [days]
repetition number in this series
0
memorised on
scheduled repetition
scheduled repetition interval
last repetition or drill
Details
No repetitions
Discussion
Do you want to join discussion? Click here to log in or create user.