Online visitors

People learning around the world

Online

—

Visitors exploring W3Schools

Online visitors by country Circles show approximate country locations. The country list provides the visitor counts.

Circles represent countries, not exact visitor locations.

Country

Online

Loading country activity…

    Python Program to Find Square Root of Positive Numbers

    Python Programming Examples


    This Python example code demonstrates a basic Python program for finding the square root of positive numbers.

    Program:

    #Variable definition and assignment
    num = 16 
    
    #Remove comments from the bottom lines to take input from the user
    #num = float(input('Enter a number: '))
    
    #Calculation to find square root
    sroot = num ** 0.5
    
    # Print the output
    print('The square root of %0.3f is %0.3f'%(num ,sroot))

    Program Output:

    The square root of 16.000 is 4.000


    Found This Page Useful? Share It!
    Get the Latest Tutorials and Updates
    Join us on Telegram

    Notifications

    Updates are enabled for this browser.

    Receive new tutorials, articles and learning resources. You can turn updates off anytime.