static string Technology(string post)
{
if (post.Contains("Twitter") || post.Contains("elon"))
{
return "loser";
}
else
{
return "cool";
}
}
You must log in or register to comment.
Unfortunately, when I ran this post through this code it returned “loser”.
5/7
Could be a Ternary operator.
Now this thread contains more Technology than most Musk ones.
Please, be reasonable:
return post.Contains("Twitter") || post.Contains("elon") ? "loser" : "cool";
Yes, but the original is better for us who have just barely scatched python or bash scripting at some point.
Order of operations is too ambiguous, needs more parentheses
So when I talk about watermelons I’m suddenly a loser :(?