New course! Every coder should learn Generative AI!
Try a free lesson0
Why does this âgetsâ not work? If I place an integer in place of âgetsâ the program works fine. Curious!
2 Answers
+ 3
You might want to convert num to a number, not a string:
num = gets.to_i
+ 1
Ohhhhh! Thanks!