Help with Python Code Challenges - Control Flow

Hello
challenge 1: i dont understand what they mean : "If base raised to the exponent is greater than 5000"
can someone please advise?

Take two to the power four, 2^4 which is equivalent to two mulitplied by itself four times, 2 * 2 * 2 * 2. In this case 2 is the base and 4 is the exponent. This would be equal to 16 and therefore less than 5000. You’re looking to do something when the output is above 5000.
Edit: Just noticed Python in the title so it’d be 2**4.

thanks for the reply.
Im confused as to how you understood that its ‘2 is the base and 4 is the exponent’.
the only figure supplied was 5000. or im i just not getting this bit?
thanks in advance.

1 Like

Hello @ruby9015221395 and welcome to the forums :smile:

In this case they are not asking you to pay attention to what the base and exponent are, just what their answer is.
The if gate is only checking if the answer is more than 5000.
You could see this same principle with adding.

This code will return False:

if 7 + 5 > 20:
   return True
else:
    return False

However if you change the numbers, this code will return True:

if 10 + 12 > 20:
    return True
else:
    return False

They want you to understand how to use the if gate for a variety of numbers.

Thanks 8-bitgaming
I understand this better now.

thanks.

1 Like