Python Forum
check if the number is a prime integer
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
check if the number is a prime integer
#2
I would get rid of liste_number entirely. Just exit the loop if you find there's no remainder, and print the message. That would be faster, but I also think it would be easier to read.
Reply


Messages In This Thread
RE: check if the number is a prime integer - by micseydel - Sep-25-2019, 10:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Prime number detector Mark17 5 901 Nov-27-2023, 12:53 PM
Last Post: deanhystad
  extracting x from '(x)' as an integer number Hwolff1962 3 941 Mar-23-2023, 02:50 PM
Last Post: Hwolff1962
  Pairs of multiplied prime number--->N Frankduc 13 3,720 Jan-16-2022, 01:52 PM
Last Post: Frankduc
  Factorial Code is not working when the given number is very long integer Raj_Kumar 2 2,369 Mar-31-2020, 06:40 PM
Last Post: deanhystad
  How to check if user entered string or integer or float?? prateek3 5 11,431 Dec-21-2019, 06:24 PM
Last Post: DreamingInsanity
  Is 2 a prime number? for loop & range fuction in python docs says yes, mine says no. allusernametaken 4 2,990 Nov-17-2019, 02:56 AM
Last Post: allusernametaken
  Error when entering letter/character instead of number/integer helplessnoobb 2 7,197 Jun-22-2019, 07:15 AM
Last Post: ThomasL
  Creating a program to look for the largest prime number of a number Wikki14 4 3,969 Sep-08-2018, 12:30 AM
Last Post: Skaperen
  Unexpected result in simple prime number example jackhj 2 3,066 Apr-20-2018, 01:48 AM
Last Post: jackhj
  python prime number algorithm zowhair 3 3,860 Dec-20-2017, 06:22 PM
Last Post: zowhair

Forum Jump:

User Panel Messages

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