Bird
Raised Fist0
Intro to Computingfundamentals~10 mins

Why networks enable communication in Intro to Computing - Test Your Understanding

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to show how devices connect in a network.

Intro to Computing
devices = ['Computer', 'Phone', 'Printer']
network = [1](devices)
print(network)
Drag options to blanks, or click blank then click option'
Aset
Blist
Cdict
Dtuple
Attempts:
3 left
💡 Hint
Common Mistakes
Using a set which does not keep order.
Using a dict which needs key-value pairs.
2fill in blank
medium

Complete the code to send a message from one device to another.

Intro to Computing
def send_message(sender, receiver, message):
    print(f"{sender} sends to {receiver}: {message}")

send_message('Phone', 'Computer', [1])
Drag options to blanks, or click blank then click option'
A'Hello!'
BHello
Cmessage
Dsend
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around the message.
Using a variable name that is not defined.
3fill in blank
hard

Fix the error in the code that simulates devices communicating in a network.

Intro to Computing
network = {'Computer': 'Online', 'Phone': 'Offline'}
status = network.get([1])
print(status)
Drag options to blanks, or click blank then click option'
A'Phone'
B'Tablet'
CPhone
DTablet
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name without quotes.
Using a key not in the dictionary.
4fill in blank
hard

Fill both blanks to create a dictionary showing device statuses and check if a device is online.

Intro to Computing
devices_status = [1](Computer='Online', Phone='Offline')
if devices_status.get('Computer') == [2]:
    print('Computer is connected')
Drag options to blanks, or click blank then click option'
Adict
B'Online'
C'Offline'
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using list instead of dict.
Comparing to 'Offline' instead of 'Online'.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps devices to their status if they are online.

Intro to Computing
devices = ['Computer', 'Phone', 'Printer']
statuses = {'Computer': 'Online', 'Phone': 'Offline', 'Printer': 'Online'}
online_devices = { [1]: [2] for [3] in devices if statuses[[3]] == 'Online' }
Drag options to blanks, or click blank then click option'
Adevice
Bstatuses[device]
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name not defined in the loop.
Mixing up keys and values in the comprehension.

Practice

(1/5)
1. Why do networks enable communication between devices?
easy
A. Because devices do not need rules to communicate
B. Because devices work only when disconnected
C. Because networks block all messages
D. Because they connect devices to share information

Solution

  1. Step 1: Understand the role of networks

    Networks connect different devices like computers and phones so they can share data.
  2. Step 2: Identify the purpose of connection

    Sharing information is only possible when devices are connected through a network.
  3. Final Answer:

    Because they connect devices to share information -> Option D
  4. Quick Check:

    Networks connect devices = communication [OK]
Hint: Networks connect devices to share data quickly [OK]
Common Mistakes:
  • Thinking devices communicate without connection
  • Believing networks block messages
  • Ignoring the need for connection
2. Which of the following is the correct way networks send messages safely?
easy
A. By following rules called protocols
B. By using random guesses to send data
C. By ignoring errors in messages
D. By sending messages without addresses

Solution

  1. Step 1: Identify how networks send messages

    Networks use special rules called protocols to send messages correctly and safely.
  2. Step 2: Understand the importance of protocols

    Protocols ensure messages reach the right device without errors.
  3. Final Answer:

    By following rules called protocols -> Option A
  4. Quick Check:

    Protocols = safe message sending [OK]
Hint: Protocols are rules networks follow to send messages [OK]
Common Mistakes:
  • Thinking messages are sent by guessing
  • Ignoring message errors
  • Sending messages without addresses
3. Look at this simple flowchart of sending a message over a network:



What happens if the device is not connected?
medium
A. The message is sent anyway
B. The message is not sent
C. The device restarts automatically
D. The message is sent twice

Solution

  1. Step 1: Follow the flowchart decision

    The flowchart checks if the device is connected before sending a message.
  2. Step 2: Understand the outcome if not connected

    If the device is not connected, the message is not sent to avoid errors.
  3. Final Answer:

    The message is not sent -> Option B
  4. Quick Check:

    Not connected = no message sent [OK]
Hint: No connection means no message sent [OK]
Common Mistakes:
  • Assuming message sends without connection
  • Thinking device restarts automatically
  • Believing message duplicates
4. This code tries to send a message over a network:
if connected = True:
    send_message()
else:
    print('No connection')

What is wrong with this code?
medium
A. The print statement is incorrect
B. It should use 'else if' instead of 'else'
C. It uses '=' instead of '==' to check connection
D. The send_message() function is missing parentheses

Solution

  1. Step 1: Identify the condition syntax error

    The code uses '=' which assigns value instead of '==' which compares values.
  2. Step 2: Explain correct comparison usage

    To check if connected is True, use '==' or simply 'if connected:'
  3. Final Answer:

    It uses '=' instead of '==' to check connection -> Option C
  4. Quick Check:

    Use '==' for comparison, '=' is assignment [OK]
Hint: Use '==' to compare, '=' assigns value [OK]
Common Mistakes:
  • Using '=' instead of '==' in conditions
  • Confusing else with else if
  • Forgetting parentheses in function calls
5. A company wants to send a message from one office to another far away. Which network feature makes this possible?
hard
A. Networks use protocols to send messages over long distances
B. Networks only work within one room
C. Networks block messages to distant places
D. Networks require devices to be physically connected by wires only

Solution

  1. Step 1: Understand network distance capability

    Networks can connect devices far apart using protocols and infrastructure like the internet.
  2. Step 2: Identify how messages travel long distances

    Protocols and network devices route messages safely over long distances, not limited to wires or rooms.
  3. Final Answer:

    Networks use protocols to send messages over long distances -> Option A
  4. Quick Check:

    Protocols enable long-distance communication [OK]
Hint: Protocols enable messages to travel far [OK]
Common Mistakes:
  • Thinking networks only work in one room
  • Believing messages are blocked over distance
  • Assuming only wired connections exist