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

ความคิดเห็น • 51

  • @carat_007
    @carat_007 หลายเดือนก่อน +1

    After 5 years I am watching it is helping me alot. Thank you sir

  • @hemapriyagunasekaran6255
    @hemapriyagunasekaran6255 ปีที่แล้ว +3

    After 4 years I'm watching your videos... It helps me a lot sir...

  • @elenaianachi1705
    @elenaianachi1705 4 ปีที่แล้ว +7

    I really like your courses, very well explained, thanks ! 👍👍👍

    • @sdetpavan
      @sdetpavan  4 ปีที่แล้ว +2

      Glad to hear that!

  • @joeljosh3877
    @joeljosh3877 4 ปีที่แล้ว +2

    sir,you tell us the the program in a systematical way that is one of the main keys for understanding any program.

  • @nimaleshdroid4388
    @nimaleshdroid4388 2 หลายเดือนก่อน

    great, felt understanding in a very simple and elegant manner.

    • @sdetpavan
      @sdetpavan  2 หลายเดือนก่อน +1

      Thanks

  • @kvelez
    @kvelez ปีที่แล้ว +1

    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}")

  • @apnvlogs7641
    @apnvlogs7641 4 หลายเดือนก่อน +2

    thank you so much sir

    • @sdetpavan
      @sdetpavan  4 หลายเดือนก่อน

      Welcome

  • @daniellejdevlin8882
    @daniellejdevlin8882 3 ปีที่แล้ว +4

    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

    • @shivaprasad-gn6dc
      @shivaprasad-gn6dc ปีที่แล้ว +1

      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 .

  • @kasireddylaxmi5609
    @kasireddylaxmi5609 7 หลายเดือนก่อน

    Sir your explanation is awesome i am waiting for videos on react js sir

  • @abdullahgazi278
    @abdullahgazi278 ปีที่แล้ว +1

    can anyone tell this program is right or wrong fr prime number:
    number = int(input("Enter number: "))
    if number

    • @nvnkb
      @nvnkb 10 หลายเดือนก่อน

      wrong because what if the number is divisible by 5? for example, 25

  • @anushribora8887
    @anushribora8887 ปีที่แล้ว +1

    Well explained 👍🏻

  • @patilabhijeetj
    @patilabhijeetj ปีที่แล้ว

    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?

  • @deepakSharma-cf5qo
    @deepakSharma-cf5qo 5 หลายเดือนก่อน +1

    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")

    • @namanmathew6607
      @namanmathew6607 4 หลายเดือนก่อน +1

      Check indentation for the if loop

  • @adityajadhav3507
    @adityajadhav3507 8 หลายเดือนก่อน +1

    Thank you sir

    • @sdetpavan
      @sdetpavan  8 หลายเดือนก่อน

      Welcome

  • @binamtuladhar3860
    @binamtuladhar3860 4 หลายเดือนก่อน

    i don't understand why is it showing 4 is a prime number when i use this code

  • @kmahendra6691
    @kmahendra6691 2 ปีที่แล้ว +1

    it's a good logic sir thank you

  • @tcimert
    @tcimert ปีที่แล้ว +2

    good👌

  • @joeljosh3877
    @joeljosh3877 4 ปีที่แล้ว +2

    sir can we write (n%2!=0) as condition for checking prime number

  • @cagnkoroglu7739
    @cagnkoroglu7739 ปีที่แล้ว +1

    #%%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

  • @chellaboinanarsimha8223
    @chellaboinanarsimha8223 3 ปีที่แล้ว +2

    How to find prime numbers between two numbers

    • @kkkg123
      @kkkg123 ปีที่แล้ว

      Jst using range loop

  • @thanushshetty4531
    @thanushshetty4531 2 ปีที่แล้ว

    For 0 this won't work na?
    We need to use else for n

  • @siddumurthy1734
    @siddumurthy1734 5 ปีที่แล้ว +1

    Well explained.

  • @kumarnaikb7901
    @kumarnaikb7901 4 ปีที่แล้ว +1

    Great👍👏

  • @siddumurthy1734
    @siddumurthy1734 5 ปีที่แล้ว +1

    Thanks Pavan Ji

  • @withkarishma
    @withkarishma 4 หลายเดือนก่อน

    Program does not execute

  • @DhrumilSoni812
    @DhrumilSoni812 4 ปีที่แล้ว +5

    # 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.

  • @EBKCS_UTTAMSONI
    @EBKCS_UTTAMSONI 2 ปีที่แล้ว

    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")

  • @ajaychandra2001
    @ajaychandra2001 ปีที่แล้ว

    a,b = b,a

  • @swethavenkatesh9390
    @swethavenkatesh9390 3 ปีที่แล้ว

    But number 9 is a not a prime number but it's show as prime in this program

    • @tcimert
      @tcimert ปีที่แล้ว

      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")

  • @kommalapatimanjula8268
    @kommalapatimanjula8268 ปีที่แล้ว +1

    Vedios is not clear bro

  • @MahendraSurya-p1u
    @MahendraSurya-p1u 11 หลายเดือนก่อน

    i want your guidance for getting job can i get your number sir...