Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set the priority of a zone fill.
PCB Design
zone.setPriority([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string instead of an integer for priority.
Setting priority to zero which disables priority.
✗ Incorrect
The priority value 10 is commonly used to set a medium priority for zone fills.
2fill in blank
mediumComplete the code to check if a zone has higher priority than another.
PCB Design
if zone1.priority [1] zone2.priority:
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using < instead of > which reverses the logic.
Using equality check instead of comparison.
✗ Incorrect
Higher priority means a greater numeric value, so use > to compare.
3fill in blank
hardFix the error in the code to correctly assign priority to overlapping zones.
PCB Design
zoneA.priority = [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Assigning string values instead of integers.
Leaving priority as None which disables it.
✗ Incorrect
Priority must be an integer value, not a string or None.
4fill in blank
hardFill both blanks to set and compare zone priorities correctly.
PCB Design
zone1.setPriority([1]) if zone1.priority [2] zone2.priority:
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using < instead of > in comparison.
Setting priority to a lower value than intended.
✗ Incorrect
Set zone1 priority to 15 and check if it is greater than zone2's priority.
5fill in blank
hardFill all three blanks to create a dictionary mapping zones to their priorities and filter high priority zones.
PCB Design
zone_priorities = [1]: zone.getPriority() for zone in zones if zone.getPriority() [2] [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using zone.id instead of zone.name as dictionary key.
Using < instead of > in the filter condition.
✗ Incorrect
Use zone.name as key, filter zones with priority greater than 10.
