Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Python numeric built-ins code

Practice abs(), divmod(), and pow().

Beginner ~6 min read

Challenge 1

Find the positive distance between the two temperatures.

python Your answer
morning = 7
evening = 19
distance = 
print(distance)

Press Ctrl⌘Enter to check your answer

Challenge 2

Split 137 minutes into whole hours and leftover minutes.

python Your answer
hours, minutes = 
print(hours, minutes)

Press Ctrl⌘Enter to check your answer

Challenge 3

Calculate 2 raised to the seventh power.

python Your answer
result = 
print(result)

Press Ctrl⌘Enter to check your answer

Challenge 4

Find 8 to the fifth power modulo 7 without writing the full power first.

python Your answer
result = 
print(result)

Press Ctrl⌘Enter to check your answer