Coding Challenge: Neither Yes nor No

Learn how to write a code that doesn't stop prompting for user input unless the user enters 'y' or 'n'. Good luck!

Problem statement

Write a program that plays “neither yes, nor no” with the user. Specifically, the program asks the user to enter text until either y'y' or n'n' is typed, which ends the game.

Input

Hello
World
y

Expected output

Hello 
World
You just lost!

Coding exercise

Get hands-on with 1200+ tech skills courses.