Python Forum
how to find a next prime number?
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to find a next prime number?
I have a question that makes me so confused ...
I have to complete 「nextPrime()」 function so that it will return the smallest prime number that is greater than the input n. For example, if input is 6.4, the function should return 7. n can be any decimal number.


Messages In This Thread
how to find a next prime number? - by iamyourfather - Oct-01-2017, 08:15 AM
RE: how to find a next prime number? - by buran - Oct-01-2017, 08:18 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  calculate the 10001st prime number topologh 7 3,976 Oct-05-2020, 07:41 PM
Last Post: deanhystad
  Prime number code ryfoa6 3 1,676 Mar-21-2020, 12:23 AM
Last Post: ryfoa6
  Trouble interpreting prime number code ryfoa6 1 1,085 Mar-20-2020, 03:47 PM
Last Post: stullis
  Prime number Python homework mkrisz98 11 2,905 May-10-2019, 05:23 PM
Last Post: mkrisz98
  How to find the accuracy vs number of neighbours for KNN vokoyo 3 1,746 Apr-10-2019, 03:46 AM
Last Post: scidam
  python age calculator need to find the number of years before they turn 100 not using orangevalley 4 5,551 Mar-26-2018, 04:44 AM
Last Post: PyMan

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020