Question 32: Write a Program to find the Square Root of a Number in Python
Solution 1:
'''
Python Program 32: A
Find the Square Root of a number using
using math sqrt() function
Author: Code2care.org
Version: v1.0
Date: 8 July 2023
'''
import math
number = 64
square_root = math.sqrt(number)
print(square_root)
Output: 8.0
Solution 2:
'''
Python Program 32: B
Find the Square Root of a number using
using exponentiation operator
Author: Code2care.org
Version: v1.0
Date: 8 July 2023
'''
number = 900
square_root = number ** 0.5
print(square_root)
Output: 30.0
Solution 3:
'''
Python Program 32: C
Find the Square Root of a number using
using pow() function
Author: Code2care.org
Version: v1.0
Date: 8 July 2023
'''
number = 4
square_root = pow(number,0.5)
print(square_root)
Output: 2.0
-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to Python-Programs,
- Program 5: Find Sum of Two Integer Numbers - 1000+ Python Programs
- Program 8: Multiply Two Numbers - 1000+ Python Programs
- Python Program: Use NumPy to generate a random number between 0 and 1
- 25: How to rename a file using Python Program
- 22: Send Yahoo! Email using smtplib - SMTP protocol client using Python Program
- Program 15: Find String is a Palindrome or Not - 1000+ Python Programs
- 21: Program to Delete File or Folder in Python
- Program 14: Sum of Even Numbers from 1 to 100 - 1000+ Python Programs
- Program 2: Print your name using print() function - 1000+ Python Programs
- 20 - Python - Print Colors for Text in Terminal - 1000+ Python Programs
- 16: Find the largest element in a List - 1000+ Python Programs
- 33: Python Program to find the current time in India (IST)
- 23: Python Programs to concatenate two Lists
- 27: Measure Elapsed Time for a Python Program Execution
- 18: Get Sub List By Slicing a Python List - 1000+ Python Programs
- Program 10: Modulo of Two Numbers - 1000+ Python Programs
- Program 1: Print Hello World! - 1000+ Python Programs
- Program 11: Calculate Percentage - 1000+ Python Programs
- Program 12: Calculate Area and Circumference of Circle - 1000+ Python Programs
- 17: Find Factorial of a Number - 1000+ Python Programs
- 35: Python Program to find the System Hostname
- 19: Simple Calculator using built-in functions - 1000+ Python Programs
- 34: Traverse a List in Reverse Order - 1000+ Python Programming
- Program 3: Print the name of user as input - 1000+ Python Programs
- Program 9: Divide Two Numbers - 1000+ Python Programs
More Posts:
- Keyboard shortcut to close tab in Notepad++ - NotepadPlusPlus
- SwissCovid App Launched in Switzerland - News
- Notepad++ Hex Editor - NotepadPlusPlus
- Android Eclipse This version of the rendering library is more recent than your version of ADT plug-in. Please update ADT plug-in - Android
- How to restore closed file in Notepad++ - NotepadPlusPlus
- Relative Imports examples in Python 3.x - Python
- How to set CSS background-Image Property - CSS
- Terminal display next month Calendar - Linux