PerfectSquare

    0

    0

    Mahendra Kumar

    basicMathsbeginner

    To find whether the given number is a perfect square or not.

    import math 
    # take inputs
    num = int(input('Enter number: '))
    root = math.sqrt(num)
    # check number is perfecct square
    if int(root + 0.5) ** 2 == num:
        print(num, 'is a perfect square')
    else:
        print(num, 'is not a perfect square')
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.