Complete the code to print the main role of an operating system.
print('The main role of an operating system is to manage [1].')
The operating system manages the hardware resources of a computer, such as CPU, memory, and devices.
Complete the code to list an example of an operating system.
example_os = '[1]' print(f'An example of an operating system is {example_os}.')
Windows is a widely used operating system. The others are applications.
Fix the error in the code to show the OS managing memory.
def manage_memory(): print('Operating system manages [1] allocation.') manage_memory()
The operating system manages memory allocation to programs and processes.
Fill both blanks to create a dictionary of OS examples and their types.
os_examples = {'Windows': '[1]', 'Linux': '[2]'}
print(os_examples)Windows is a proprietary OS, while Linux is open-source.
Fill the blank to create a dictionary comprehension filtering OS names starting with 'W'.
filtered_os = {name: type_ for name, type_ in os_examples.items() if name.[1]('W')}
print(filtered_os)The startswith() method checks if the OS name begins with 'W'.
