Ruby Learning # 23 For Loops

friends =["Kevin","Karen","Oscar","Angela","Andy"]

for friend in friends puts friend end

Kevin Karen Oscar Angela Andy

for element in friends puts element end

Kevin Karen Oscar Angela Andy

friends.each do |friend| puts friend end

Kevin Karen Oscar Angela Andy

for index in 0..5 puts index end

0 1 2 3 4 5

6.times do |index| puts index end

0 1 2 3 4 5

Recommended Posts

Ruby Learning # 23 For Loops
Ruby Learning # 21 While Loops
Ruby learning 4
Ruby learning 5
Ruby learning 3
Ruby learning 2
Ruby learning 6
Ruby learning 1
Ruby Learning # 25 Comments
Ruby Learning # 13 Arrays
For JAVA learning (2018-03-16-01)
Ruby Learning # 1 Introduction
Ruby Learning # 34 Modules
Ruby Learning # 14 Hashes
Ruby Learning # 33 Inheritance
Ruby Learning # 15 Methods
Ruby Learning # 30 Initialize Method
abbreviation for ruby method
Ruby learning points (basic)
Ruby Learning # 29 Classes & Objects
Ruby Learning # 20 Case Expressions
Ruby Learning # 24 Exponent Method
Ruby Learning # 17 If Statements
Ruby Learning # 31 Object Methods
Ruby Learning # 27 Writing Files
Ruby Learning # 35 Interactive Ruby (irb)
Ruby Learning # 9 Math & Numbers
Ruby Learning # 28 Handling Errors
Ruby Learning # 26 Reading Files
Ruby Learning # 16 Return Statement
Scraping for beginners (Ruby)
Ruby Learning # 2 Drawing a Shape
Ruby on rails learning record -2020.10.03
Ruby on rails learning record -2020.10.05
Ruby on rails learning record -2020.10.09
Books used for learning Java
Ruby on Rails basic learning ①
Ruby Learning # 99 Personal Programming Notebook
Ruby on rails learning record-2020.10.07 ②
Ruby Learning # 10 Getting User Input
[Ruby] What is `!!` used for?
Ruby Learning # 32 Building a Quiz
Ruby Learning # 8 Working With String
Ruby on rails learning record -2020.10.06
Spring Boot for annotation learning
[ruby + excel] Precautions for Save As
Completed Progate Ruby Learning Course III
Learning Ruby with AtCoder 6 [Contest 168 Therefore]
Completed Progate Ruby Learning Course II
[Ruby] Escape from multiple loops [Nest]
Ruby convenience methods for fledgling engineers
Recommended learning method for programming beginners
Learning guidelines for Android development for iOS engineers
[Ruby] Writing notes for cherry books [Notes for yourself]
Getting Started with Ruby for Java Engineers
Item 58: Prefer for-each loops to traditional for loops
Kotlin learning notes (features useful for development)
Learning Ruby with AtCoder 7 [Contest 168 Triple Dots]
[Ruby on Rails] About bundler (for beginners)
[Beginner] Various iterative processing for Ruby arrays
Ruby Learning # 12 Building a Mad Libs Game