0
0
Software Engineeringknowledge~10 mins

Risk monitoring and control in Software Engineering - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a risk monitoring function that logs risk status.

Software Engineering
def monitor_risk(risk_level):
    if risk_level > 5:
        [1]("High risk detected")
Drag options to blanks, or click blank then click option'
Alog
Bnotify
Cprint
Dalert
Attempts:
3 left
💡 Hint
Common Mistakes
Using undefined functions like 'log' or 'alert' without imports.
2fill in blank
medium

Complete the code to check if the risk status is 'critical' and trigger an alert.

Software Engineering
risk_status = 'critical'
if risk_status == [1]:
    print('Alert: Critical risk!')
Drag options to blanks, or click blank then click option'
A'high'
B'critical'
C'medium'
D'low'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around string literals.
3fill in blank
hard

Fix the error in the code to correctly update the risk level in the dictionary.

Software Engineering
risk_data = {'level': 3}
risk_data['level'] [1] 7
Drag options to blanks, or click blank then click option'
A-=
B==
C+=
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '=' for assignment.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that filters risks with level greater than 4.

Software Engineering
filtered_risks = {k: v for k, v in risks.items() if v [1] [2]
Drag options to blanks, or click blank then click option'
A>
B4
C<
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' causing wrong filtering.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that converts risk names to uppercase and filters risks with level at least 3.

Software Engineering
result = { [1]: [2] for [3] in risk_dict.items() if [2] >= 3 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
Ck, v
Drisk_dict
Attempts:
3 left
💡 Hint
Common Mistakes
Using the dictionary name instead of key variable in comprehension.