Last time, I studied the most basic variables and functions in programming. This time, the memo of the if else statement used in the conditional branch is described below.
if ~ then
Process 1
elsif ~ then
Process 2
else
Process 3
Is the basic shape
I tried to create a program with if else to judge whether that year is the year of the Olympic Games
year = 2021
if year%4 == 0 then
print("This year is the olympic games")
elsif year == 2021 then
print("This year is the olympic games(Prolonged by coronavirus)")
else
print("This year is not the Olympics")
end
https://www.javadrive.jp/ruby/numeric_class/index6.html
Recommended Posts