Do I need to use an if statement to solve this?

Can’t we just type:

def large_power(base, exponent):
  return base**exponent > 5000

Instead of using if/else statements to tell it to return true false?

1 Like

Yes, that will work as expected since the expression is evaluated first, and the outcome is returned.

A lot of exercises expect to see the if statement in the code so read the instructions carefully before reverting to shortcuts.