Ask coding questions

← Back to all posts
What do I do so it does't say "yesOkay." in the console?

Please help me with this.

PattanAhmed (1103)

Change your code like this:-

io.write('Enter your name: ')
name_input =
io.write("Enter your age: ")
age_input =

io.write("Hello, " .. name_input .. ', you are ' .. age_input .. ' years old, is that correct?: ')

reply =
if reply == ('yes') then print('Okay!')

-- Additionally, I added this if you want you can remove it too:-

That's it

Hope this helps

Coder100 (8720)

Because io.write('yes') will print out yes and then return true and so then it will print ok.

To solve the problem, compare reply1 instead of printing out the expected input smh

if reply1 == 'yes' then
print ('okay. ')
Wumi4 (94)

This is very simple to fix. On line 9 at your repl, fix with this line of code:

if reply1 == ('yes') then print(' Okay.')

Have a nice day!

Coder100 (8720)

what's with the ('yes')? Also why did you not end the if statement smh @DangHoang2