Home > Software engineering >  How to get user input with string prompt?
How to get user input with string prompt?

Time:04-30

I'd like to get a user's input with a prompt, how can I do that in ruby?

If I've explained poorly what my problem is, here is an example written in python of what I would like to do: Input("Prompt: ")

Thanks

CodePudding user response:

print("Prompt: ")
answer = gets.chomp
  •  Tags:  
  • ruby
  • Related