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?
#1
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.

THANK YOU SO MUCH Cry Cry Cry
Reply


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
  Trying to find the next prime number FirstBornAlbratross 8 4,079 Aug-14-2023, 01:16 PM
Last Post: deanhystad
  Python Program to Find the Factorial of a Number elisahill 2 1,383 Nov-21-2022, 02:25 PM
Last Post: DeaD_EyE
  calculate the 10001st prime number topologh 7 6,168 Oct-05-2020, 07:41 PM
Last Post: deanhystad
  Prime number code ryfoa6 3 2,859 Mar-21-2020, 12:23 AM
Last Post: ryfoa6
  Trouble interpreting prime number code ryfoa6 1 2,221 Mar-20-2020, 03:47 PM
Last Post: stullis
  Prime number Python homework mkrisz98 11 5,517 May-10-2019, 05:23 PM
Last Post: mkrisz98
  How to find the accuracy vs number of neighbours for KNN vokoyo 3 3,110 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 9,848 Mar-26-2018, 04:44 AM
Last Post: PyMan

Forum Jump:

User Panel Messages

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