Skip to content

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.

Notifications You must be signed in to change notification settings

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages