I want to do something like that.
puts "Please write your age: "
age = gets.chomp
if #{age}<18
puts "you are illegal"
else #{age}>18
puts "You are legal"
end
the output i get is:
"Please write your age" 15. you are illegal you are legal"
and this
"Please write your age 20 you are illegal you are legal"
Why? And what is the solution please?
What I expect is this If I write 19 or older, it will say "you are legal" And if I write 17 or any number below It will tell me "You are illegal"