Complete the code to identify the initial state of a process.
process_state = "[1]" # The state when a process is first created
The new state is the first state of a process when it is created but not yet ready to run.
Complete the code to represent the state when a process is waiting for CPU time.
process_state = "[1]" # The state when a process is ready to run but waiting for CPU
The ready state means the process is prepared to run but is waiting for the CPU to become available.
Fix the error in the code to show the state when a process is actively executing instructions.
process_state = "[1]" # The state when the process is currently using the CPU
The running state means the process is currently executing on the CPU.
Fill both blanks to represent the state when a process is waiting for an event and the state when it has finished execution.
if event_not_occurred: process_state = "[1]" else: process_state = "[2]"
The waiting state is when a process waits for an event like I/O completion. The terminated state means the process has finished execution.
Fill all three blanks to create a dictionary mapping process states to their descriptions.
process_states = {
"new": "[1]",
"ready": "[2]",
"terminated": "[3]"
}This dictionary explains key process states: new means just created, ready means prepared to run, and terminated means finished.