Computer Science, asked by sammyog303, 9 months ago

how do u make the below statement simple without changing what it does?

'if (crowd > 500) == True:
return "Crowded"
elif (crowd < 5) == True:
return "Empty"
else:
return "Okay"'

Answers

Answered by Raghav1330
0

' if (5<crowd<500) ==True;

return"Okay";

elseif (crowd<5) == True;

return "Empty";

or (crowd>500) == True;

return "Crowded"

  • We write the "Okay" statement as range between 5 and 500.
  • we combine "else" and "If or" statements and made a complex statement.
  • in this complex statements we wrote "Empty" and "Crowded" statements together.
Similar questions