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