if a > b if b > 7 print(“C is greater than A”) else if b > 7 print(“B is greater than…
- User
if a > b
if b > 7
print(“C is greater than A”)else if b > 7
print(“B is greater than A”) Calculate the total Cognitive Weight - Assistant
Below is one common way to “weight” the code. One accepted method is to assign a basic weight of 2 to every decision structure (e.g. every “if‐statement”) and then multiply that basic weight by a “nesting level” factor. In our example the idea is to count each decision at its depth level:
-
The outer if (
if a > b) is at nesting level 1.
Weight = 2 × 1 = 2
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.