Lecture

Key Expressions for Input and Output

In programming, it is common to print a message to the console to check the value of a specific variable or to log to manage the program's state.

When expressing situations related to input and output in English, it is important to use verbs and prepositions accurately.

Small differences can lead to unnatural or incorrect expressions.

In this lesson, we will look at key expressions related to input and output using the console and files, and explore how these expressions are used in actual programming scenarios.

Quiz
0 / 1

What expression is used when printing messages to the console or logging?

When outputting messages to the console, the expression ' ' is commonly used.
log on
print to
sign in
record on

Lecture

AI Tutor

Design

Upload

Notes

Favorites

Help

Expressions Related to Console, File I/O, and User Messages

Print logs to the console

print logs to the console

Print debug logs to the console.

This is an expression used when displaying messages on the console. 'Print logs' is commonly used during debugging.

Log

log

Log errors to a file.

'Log' can be a noun meaning 'record,' or a verb meaning 'to record' or 'leave logs.'

Display an error message to the user

display an error message to the user

Display a warning message.

'Display' is a verb used to visually show messages on a screen or UI.

Read data from a (file/URL)

read data from a (file/URL)

Reads data from a configuration file.

'Read' is a verb used when retrieving data from external files or URLs, and is used with 'from.'

Write data to a (file/URL)

write data to a (file/URL)

Write changes to a disk.

'Write' is a verb used to store or record data externally and is used with 'to.'

Append data to a file

append data to a file

Append new entries to the log file.

'Append' is used when adding data by preserving the contents of an existing file.

Prompt the user for input

prompt the user for input

The script prompts the user for their credentials.

'Prompt' is a verb used when requesting input or responses from a user, used in the form 'prompt A for B.'