class Program
{
static void Main()
{
var ids = new Dictionary<string, bool>() { { "X1", true } };
// We can specify the "out" type by argument.
if (ids.TryGetValue("X1", out bool result))
{
Console.WriteLine($"VALUE: {result}");
}
}
}
//validation
while(!(jukeBoxSongs.TryGetValue(userInput,out user)))
{
Console.WriteLine("tell the user what they did wrong");
Console.WriteLine(" restate the question");
userInput = Console.ReadLine();//catch the users response with the
//same string var you used before
}