0Pricing
Ruby Academy · Lesson

User Input and Output

Capture user input from the console and format output using puts and gets.

1

User Input and Output

Interacting with users through input and output is an essential part of many applications.

In this lesson, you will learn how to capture user input and format output using puts and gets.

User Input and Output — illustration 1

2

Displaying Output with puts

Use puts to print text to the console.

puts 'Hello, Ruby!'

All lessons in this course

  1. Reading and Writing Files
  2. User Input and Output
  3. Working with JSON and YAML
← Back to Ruby Academy