Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Prime numbers
#4
One other issue - in line 9 you logically "or" that the number is not 0 and not 1. 0 is not 1, and 1 is not 0, so that will always evaluate as true.
Changing that line to simply
else
should fix it.
Reply


Messages In This Thread
Prime numbers - by janoshz - Sep-30-2019, 12:32 PM
RE: Prime numbers - by ichabod801 - Sep-30-2019, 01:08 PM
RE: Prime numbers - by janoshz - Sep-30-2019, 01:34 PM
RE: Prime numbers - by jefsummers - Sep-30-2019, 02:18 PM
RE: Prime numbers - by Preetimishra90 - Oct-05-2019, 10:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Random Generator: From Word to Numbers, from Numbers to n possibles Words Yamiyozx 2 1,545 Jan-02-2023, 05:08 PM
Last Post: deanhystad
  Convert list of numbers to string of numbers kam_uk 5 3,149 Nov-21-2020, 03:10 PM
Last Post: deanhystad
  Prime numbers calculations frequency 3 3,078 Nov-27-2018, 07:07 PM
Last Post: micseydel
  10x10 Array of Prime Numbers smfox2 1 2,618 Sep-03-2018, 12:36 AM
Last Post: ichabod801
  Regular Expressions in Files (find all phone numbers and credit card numbers) Amirsalar 2 4,201 Dec-05-2017, 09:48 AM
Last Post: DeaD_EyE
  PRIME NUMBERS iamnotabot 6 4,805 Sep-17-2017, 04:25 PM
Last Post: iamnotabot
  prime factorization of two large numbers pyJim 2 3,792 Aug-24-2017, 03:19 PM
Last Post: pyJim

Forum Jump:

User Panel Messages

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