Prime number series in python with algorithm

**Q):**Implement python script to generate prime number series up to n

**Aim: **To generate prime number series up to n

**Algorithm:**

step 1: Start

step2: Declare lower variable and read

step 3: Declare higher variable and read.

step 4: In n for loop take the range of value from lower to higher .

step 5 : Check for the condition n > 1

step 6: If the condition is true go to the i for loop otherwise take the next iteration

step 7: In i for loop check the condition n % i = 0

step 8: if the condition is true then break the loop otherwise print that n value

step 9: end.

**Source code:**

lower = int(input(“enter lower range:”))

```
higher = int(input("enter higher range:"))
for num in range(lower,higher + 1):
# prime numbers are greater than 1
```

```
if num > 1:
for i in range(2,num):
if (num % i) == 0:
break
```

```
else:
print(num)
```

` `

` `

Output:

```
enter lower range:0
enter higher range:50
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
Process finished with exit code 0
```**
**

- various operation on string using string libraries with algorithm

- Factorial number in python with algorithm
- palindrome number in python with algorithm
- prime number series in python with algorithm
- Python For Loop | The break Statement | The continue Statement | The range() perform | Else sure Loop | Nested Loops
- Python Functions | Creating a operate | Parameters | Default Parameter worth | Recursion with Example
- Python Conditions and If statements |Short Hand If … Else | Indentation | Elif condition | else | One line if statement | OR | AND
- How to use print function in Python
- How to find Maximum and Minimum Values ?
- Python Lambda | Syntax | lambda arguments | def myfunc(n)
- Python Arrays |Looping |Method ar append(), clear(), extend(), insert(), pop(), reverse(), sort(), index()
- Python Classes and Objects | Create associate array containing automotive names | Looping Array parts | Adding Array parts | Removing Array parts | method push(),pop(),index(),remove() ,etc
- Python Inheritance | class Person: | Create a baby category example | Create a baby category | Add strategies
- Python Iterators | StopIteration | Stop once twenty iterations: | Create associate Iterator | Create associate Iterator
- How to add data to empty dictionary and types of data a dictionary can store
- Python Dictionary | check key and value exist or not
- Python Dictionary | Loop in dictionary | value method | keys method
- Python | value method and keys

prime number series in python with algorithm