0
Is anything wrong in this code
puts"What is your age?" a = gets.to_i case a when a<19 puts "You are a teenager." when a>19 && a<40 puts "You are a adult." when a>40 puts "You are too old." end
3 ответов
+ 1
instead of when use if with a semicolon at end of statement
+ 1
if you are python user then use this
age=input ("Enter your age:")
if a<19:
print "you are teenager"
if a(20,40):
print "you are an adult"
if a>40:
print "you are too old"
0
As I see it, if you're 19 or 40 you're nothing