Frequently Asked Python Program 2: How To Check A Number is Prime Or Not
ฝัง
- เผยแพร่เมื่อ 8 ก.พ. 2025
- Topic : How To Check A Number is Prime Or Not
#########################
Udemy Courses:
#########################
Manual Testing+Agile with Jira Tool
************************************
► shorturl.at/xNXZ4
Selenium with Java+Cucumber
********************************
► shorturl.at/aIKMW
Selenium with Python & PyTest
********************************
► shorturl.at/ELW09
Selenium with python using Robot framework
****************************************
► shorturl.at/bcDPZ
API Testing(Postman, RestAssured & SoapUI)
*****************************************
► shorturl.at/uAWY7
Web & API Automation using Cypress with Javascript
********************************************
► rb.gy/4uum2n
Playwright with Javascript
**************************
► shorturl.at/gALZ1
Jmeter-Performance Testing
************************
► rb.gy/ocj7r2
SDET Essencials(Full Stack QA)
*************************
► rb.gy/hlnf2v
Appium-Mobile Automation Testing
************************************
► rb.gy/wmzv64
Java Collections
*****************
► bit.ly/3S66ezE
Python Programming
*********************
► urlis.net/gdsf...
Cucumber BDD Framework
***************************
► bit.ly/3F7d69r
Protractor with Javascript
***************************
► urlis.net/4udd...
####################################
TH-cam Playlists:
####################################
Manual Testing & Agile
***********************
► bit.ly/3ujvaYa
► bit.ly/3OYzxQj
SQL
*************************
► bit.ly/3R6XjeG
► bit.ly/3nE0a1s
► bit.ly/3IeKuuJ
linux & Shell Scripting
**********************
► bit.ly/3up1Z6a
► bit.ly/3nzvGxx
Java
**********************
► bit.ly/3R9QfOs
► bit.ly/3AoRMKM
► bit.ly/3IbTTDn
► bit.ly/3ybXInv
► bit.ly/3yCoHdw
Selenium With Java+Cucumber
********************************
► bit.ly/3P2FMm4
► bit.ly/3yhiIt4
► bit.ly/3uokzet
► bit.ly/3a7XIND
► bit.ly/3umN2S9
► bit.ly/3aar7GW
► bit.ly/3y9kD2S
► bit.ly/3uhLskn
Python
********************************
► bit.ly/3agNgU0
► bit.ly/3NJNnoy
► bit.ly/2CTQ4mR
► bit.ly/3OIYWh1
Selenium With Python,Pytest&Behave
***************************************
► bit.ly/3OHHoC9
► bit.ly/3IeNLdv
► bit.ly/2J4tPeT
► bit.ly/3ydSkAq
Selenium With Python Using Robert Framework
(Web&API Testing)
*************************************************
► bit.ly/3nUvlpr
► bit.ly/3nUvE3z
API Testing (Postman,SoapUi,&Rest Assured)
**********************************************
► bit.ly/3OXacWY
► bit.ly/3yh0UhE
► bit.ly/3nC9DWQ
► bit.ly/3yGfhNS
► bit.ly/3OJa11H
► bit.ly/3P2slCC
Mobile App Testing Appium
****************************
► bit.ly/3Al49HG
Performance Testing Jmeter
*******************************
► bit.ly/3nz4fE7
Maven,Jenkins,Git,Github,CI/CD
*******************************
► bit.ly/3P16HPj
► bit.ly/3yhlUVA
► bit.ly/3afYfwT
► bit.ly/3yGzweG
► bit.ly/3yF73Ws
► bit.ly/3NCOmH7
SQL,DB Testing&ETL,Bigdata
*******************************
► bit.ly/3NKOcNY
► bit.ly/3OVpDyI
► bit.ly/3NEvUy0
► bit.ly/3IryxlT
► bit.ly/3RkWBLh
JavaScript Based Automation Tools
********************************
► bit.ly/3nUx51X
► bit.ly/3AqI6Q0
► bit.ly/3yeurbT
► bit.ly/3ujzpTK
Selector Hub Tools
********************
►rb.gy/h3h424
GraphQL
******************
► rb.gy/sj3gys
Cypress API Testing
********************
► shorturl.at/fjKPX
Cypress Web Testing
**********************
► shorturl.at/agjlK
Playwright with Javascipt
**************************
► shorturl.at/adSTY
#PythonPrimeCheck
#PrimeNumberCheck
#PrimeOrNot
#PythonPrimeAlgorithm
#NumberTheory
#PythonCodingChallenge
#AlgorithmicThinking
#PythonMathematics
#PrimeAlgorithm
#NumberIsPrime
#PythonCoding
#PrimeNumberLogic
#PythonNumberTheory
#AlgorithmPractice
#PythonProgramming
#PrimeCheckCode
#NumberProperty
#PythonFunctions
#CodingWithPython
#PrimeNumberTest
#PythonLoops
#NumberAnalysis
#CodingCommunity
#PythonLogic
#PrimeIdentification
#NumberManipulation
#CodeSnippet
#PythonTips
#PrimeVerification
#NumberEvaluation
#CodeLearning
#PythonTricks
#PrimeSieve
#NumberDivisibility
#CodeForBeginners
#PythonSkills
#PrimeDiscovery
#NumberTheoryExplained
#CodingJourney
#PythonExploration
#PrimeDecomposition
#NumberProperties
#CodingInPython
#PythonAlgorithm
#PrimeAnalysis
#NumberCheckAlgorithm
#CodingPractice
#PythonDevelopment
#PrimeNumberExplained
#NumberProblems
After 5 years I am watching it is helping me alot. Thank you sir
After 4 years I'm watching your videos... It helps me a lot sir...
Thanks
I really like your courses, very well explained, thanks ! 👍👍👍
Glad to hear that!
sir,you tell us the the program in a systematical way that is one of the main keys for understanding any program.
great, felt understanding in a very simple and elegant manner.
Thanks
num = int(input("Num: "))
is_prime = True
if num > 1:
for i in range(2, num):
if num%i == 0:
is_prime = False
break
print(f"Prime number: {is_prime}")
thank you so much sir
Welcome
Can you explain why number=2 shows up as prime when 2÷2=0, which would force the code to break out of loop? I know 2 is prime
Range is taken from 1 so at first 2÷1 reminder is zero then 2÷2 reminder is zero again so count =2 hence prime and the loop terminates here .
Sir your explanation is awesome i am waiting for videos on react js sir
can anyone tell this program is right or wrong fr prime number:
number = int(input("Enter number: "))
if number
wrong because what if the number is divisible by 5? for example, 25
Well explained 👍🏻
Thank you
Good one. Just one point, if we have to check input number from user then we have to typecast input to an integer. For example, num1 is the variable storing user's input then typecast it as int(num1) and then work on this. RIght?
Below code is giving error in pycharm and online compiler also. Can anyone help what is the issue.
num = int(input("enter the number"))
count = 0
if num>1:
for i in range(1,num+1):
if num % i == 0:
count = count+1
if count == 2:
print("prime")
else:
print("not prime")
Check indentation for the if loop
Thank you sir
Welcome
i don't understand why is it showing 4 is a prime number when i use this code
it's a good logic sir thank you
Welcome
good👌
Thanks
sir can we write (n%2!=0) as condition for checking prime number
no
#%%prime number
while True:
num = int(input("your number is "))
for x in range(2,num+1):
if num % x == 0:
print("not a prime num")
break
if num % x > 0:
print("prime num")
break
How to find prime numbers between two numbers
Jst using range loop
For 0 this won't work na?
We need to use else for n
Well explained.
Thanks
Great👍👏
Thanks
Thanks Pavan Ji
Welcome
Program does not execute
# Check whether Number is Prime Or Not
num = input("Enter the Number: ")
# prime Number-
# Number > 1
# Only 2 factors - 1 and Number itself.
# 19 = 1, 19
# 28 = 1, 2, 4, 7, 14, 28
count = 0
if int(num) > 1:
for i in range(1, int(num)+1):
if int(num) % i == 0:
count += 1
if count == 2:
print("Number is Prime")
else:
print("Number is not Prime")
else:
print("Number is not Prime number")
# This will handle input 1 as well.
You can mention like
Num= int(input("enter a number "))
a=int(input())
if(a/1==a and a/a==1 and a%2!=0 and a%3!=0 and a%5!=0 and a%7!=0):
print(a,":no is prime")
else:
print("no is not prime")
Interviewer be like hey Prabhu😮
a,b = b,a
But number 9 is a not a prime number but it's show as prime in this program
num = int(input("Enter a number
"))
count = 0
if num>1:
for i in range(1,num+1):
if (num%i) == 0:
count =count+1
if count == 2:
print(num,"is a prime number")
else:
print(num,"is not a prime number")
Vedios is not clear bro
Make it High quality n watch
i want your guidance for getting job can i get your number sir...