Skip to content

PR2309/Prime_Composite_Range

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฎ Prime and Composite Number Checker (Project 15)

๐Ÿ“‹ Description

This Python program helps you determine whether numbers in a given range are Prime or Composite. It also counts the total number of prime and composite numbers in the range.

๐Ÿš€ How It Works

  • Prime numbers: Numbers greater than 1 that can only be divided by 1 and themselves.
  • Composite numbers: Numbers that have divisors other than 1 and themselves.

Example:

Enter starting number: 1
Enter finishing number: 10

1 is neither prime nor composite
2 is prime
3 is prime
4 is composite
...
Count: 4 Prime and 5 Composite numbers in the range.

๐Ÿ›‘ Error Handling

  • Input validation for natural numbers (only positive integers).
  • Ensures that the starting number is less than or equal to the ending number.

๐Ÿ”ง Requirements

Python 3.x

About

A Python program that identifies prime and composite numbers within a user-defined range. Users input a range, and the program displays all prime and composite numbers within it. Ideal for practicing Python fundamentals like loops, conditionals, and number theory.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages