the variable q is assigned to some integer value. Evaluate the largest power of three that is less than or equal to the integer q, and print it. Answer: (penalty regime: 0, 0, 0, 50, 50%) Reset answer & 1 9 2 3 1139370790463835491531049608749979934433 import math print (int(math.log(q, 3)))

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 4RQ
icon
Related questions
Question
the variable q is assigned to some integer value.
Evaluate the largest power of three that is less than or equal to the integer q, and print it.
Answer: (penalty regime: 0, 0, 0, 50, 50%)
Reset answer
&
1
9
2
3
1139370790463835491531049608749979934433
import math
print (int(math.log(q, 3)))
Transcribed Image Text:the variable q is assigned to some integer value. Evaluate the largest power of three that is less than or equal to the integer q, and print it. Answer: (penalty regime: 0, 0, 0, 50, 50%) Reset answer & 1 9 2 3 1139370790463835491531049608749979934433 import math print (int(math.log(q, 3)))
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr