#!/bin/python3 -10# Complete the 'isPowerofThree' function below.Example 1:11#312# This function checks if n is a power of 3 andInput: 2713# returns true if it is and false if it is...


Given an integer, write a function to determine if it is a power of three. Return<br>Python 3<br>• Autocomplete Ready O<br>1 if the integer is a power of three or 0 if it is not.<br>1 > #!/bin/python3 -<br>10<br># Complete the 'isPowerofThree' function below.<br>Example 1:<br>11<br>#3<br>12<br># This function checks if n is a power of 3 and<br>Input: 27<br>13<br># returns true if it is and false if it is not.<br>Output: 1<br>14<br>#3<br>15<br># The function is expected to return an INTEGER.<br>16<br># The function accepts INTEGER n as parameter.<br>Example 2:<br>17<br>%23<br>18<br>#3<br>19<br>Input: 0<br>Output: 0<br>20<br>def isPowerofThree (n) :<br>21<br># Write your code here<br>22<br>23 > if --name_ == '-_main_': -<br>Example 3:<br>Input: 9<br>Output: 1<br>Example 4:<br>Input: 45<br>Output: 0<br>Line: 10 Col:<br>Note: Do NOT modify the starter code<br>Test Results<br>Custom Input<br>Submit Code<br>Run<br>

Extracted text: Given an integer, write a function to determine if it is a power of three. Return Python 3 • Autocomplete Ready O 1 if the integer is a power of three or 0 if it is not. 1 > #!/bin/python3 - 10 # Complete the 'isPowerofThree' function below. Example 1: 11 #3 12 # This function checks if n is a power of 3 and Input: 27 13 # returns true if it is and false if it is not. Output: 1 14 #3 15 # The function is expected to return an INTEGER. 16 # The function accepts INTEGER n as parameter. Example 2: 17 %23 18 #3 19 Input: 0 Output: 0 20 def isPowerofThree (n) : 21 # Write your code here 22 23 > if --name_ == '-_main_': - Example 3: Input: 9 Output: 1 Example 4: Input: 45 Output: 0 Line: 10 Col: Note: Do NOT modify the starter code Test Results Custom Input Submit Code Run

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here