Ruby help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Ruby help

Ok, so Iā€™m currently working on a project with ruby right now. I need help on one part though... so Iā€™m making it a user input thing and when someone puts in the correct input I want to to print something does anyone know how to do that?

3rd Oct 2019, 9:23 PM
Ethan
Ethan - avatar
3 Answers
+ 1
Diego alright, thanks
4th Oct 2019, 12:05 AM
Ethan
Ethan - avatar
+ 1
oh i see what i did wrong... i did ā€œ=ā€œ instead of ā€œ==ā€œ
4th Oct 2019, 12:07 AM
Ethan
Ethan - avatar
0
name = gets.chomp if name == "Ethan" puts "Correct" else puts "Wrong" end Input: Ethan Output: Correct Input: James Output: Wrong
3rd Oct 2019, 10:44 PM
Diego
Diego - avatar