Evaluation Time Discrepancy
We'll cover the following...
We'll cover the following...
Do the compile-time and runtime evaluations differ? Let’s find out.
1.
Let's see an example for a typical generator expression:2.
Let's modify the code a bit.3.
Can you predict the output of the code below?
Explanation
- In a generator expression, the
inclause is evaluated at declaration time, but the conditional clause is