id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

nearly_prime


First, solve the problem at https://codingbat.com/prob/p202587 and then come to this one. A number is called "nearly-prime" if besides, 1 and itself, it's divisible by exactly one other integer. Define a function that when passed an integer, returns true if it is nearly-prime, false otherwise.


nearly_prime(77) → False
nearly_prime(32) → False
nearly_prime(62710561) → True

...Save, Compile, Run (ctrl-enter)

def nearly_prime (n):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 3 Post-solution available

Copyright Nick Parlante 2017 - privacy