Skip to content

moroniq/next_prime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

# Next Prime Number πŸ”’

This Python script finds and returns the next prime number each time the user requests one.

## 🧠 How it works

- The program starts at 2, the first prime number.

- It checks each subsequent number to see if it is prime.

- When a prime number is found, it is printed.

- The user is asked whether they want the next prime.

- The process repeats until the user answers "no".

## πŸ’¬ Example interaction

Next prime is: 2

Do you want to continue? yes

Next prime is: 3

Do you want to continue? yes

Next prime is: 5

Do you want to continue? no

## πŸš€ Technologies used

- Python 3

- Loops and conditionals

- Modulo operator for checking divisibility

- User interaction with input()

## πŸ“‚ Files included

- next\_prime.ipynb – Jupyter Notebook with the working solution

- README.md – this file


Created with πŸ’‘ by Olga

About

πŸ”’ Python program to find consecutive prime numbers, asking the user whether to continue after each result.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors