Complete the code to identify the type of malware based on its behavior.
if malware_behavior == [1]: print("This is a ransomware.")
Ransomware encrypts files to demand payment for decryption.
Complete the code to check if a file is suspicious based on its extension.
if file_extension == [1]: print("This file might be malicious.")
Executable files (.exe) can run code and are often used by malware.
Fix the error in the code that detects if a process is running suspiciously.
if process_name == [1]: alert('Suspicious process detected!')
String values must be enclosed in quotes to be valid in code.
Fill both blanks to create a dictionary comprehension that maps file names to their sizes only if size is greater than 1000.
file_sizes = {filename: [1] for filename, size in files.items() if size [2] 1000}The comprehension keeps files with size greater than 1000 and maps filename to size.
Fill both blanks to filter a dictionary of malware samples where the name is uppercase, the type is 'trojan', and the risk score is above 7.
filtered = {sample[1]: info for sample, info in samples.items() if info['type'] == [2] and info['risk'] > 7}The sample name is converted to uppercase, info is unchanged, and type is checked as 'trojan'.