How to force user to enter an option / input on prompt?

I would like the prompt to keep looping unless the user gives an answer. Can anyone help? I’ve tried the following with no success.

unless choice.length > 1
choice = gets.chomp
choice.downcase!
end

I’ve also tried

while choice.length < 1
choice = gets.chomp
choice.downcase!
end

What are you using, Python, Java?

This is actually Ruby code

Ah, Im no use here. Sorry

Here’s a python example that will elaborate in a straightforward way,

ask = input("Keep Looping? ")
while ask != " ":
    print(ask)