Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs

Python radians

by suresh

The Python radians function is used to convert the given angle from Degrees to Radians. In this section, we discuss how to use radians function in Python with example.

The syntax of the radians Function in Python Programming Language is

math.radians(number);

Number: It can be a number or a valid numerical expression.

  • If the number argument is a positive or negative number, the radians function to return the output.
  • If it is not a number, radians function returns TypeError.

Python radians Function Example

The radians Function converts the given angle from Degrees to Radians. In this example, we use radians function to convert degrees of different data types to radians and display the output.

# Python RADIANS Function

import math

Tup = (10, 20, 80, 40 , 50) # Tuple Declaration
Lis = [80.65, 35.48, 92.65, 50.41 , 17.27] # List Declaration

print('Calculating Radians of Zero = %.2f' %math.radians(0))
print('Calculating Radians of Positive Integer = %.2f' %math.radians(6))
print('Calculating Radians of Negative Integer = %.2f' %math.radians(-12))

print('Calculating Radians of Positive Decimal = %.2f' %math.radians(4.56))
print('Calculating Radians of Negative Decimal = %.2f' %math.radians(-15.78))

print('Calculating Radians of Tuple Item = %.2f' %math.radians(Tup[2]))
print('Calculating Radians of List Item = %.2f' %math.radians(Lis[2]))

print('Calculating Radians of Multiple Numbers = %.2f' %math.radians(10 + 20 - 25))

print('Calculating Radians of PIE = %.4f' %math.radians(math.pi))
print('Calculating Radians of PIE/2 = %.4f' %math.radians(math.pi/2))
print('Calculating Radians of PIE/4 = %.4f' %math.radians(math.pi/4))
print('Calculating Radians of PIE/6 = %.4f' %math.radians(math.pi/6))

print('Calculating Radians of String Value = ', math.radians('3'))
Python RADIANS Function
  1. Within the first three statements, We used the radians Function with Zero, Positive integer, and negative integer values as arguments.
  2. Next two statements, we used the Python radians Function with both the Positive and negative decimal values as arguments.
  3. Next two Python statements, we used this Python Math functions Function on Python Tuple and Python Lis items. If you observe the above screenshot, the radians function is working perfectly on them.
  4. We tried radians Function directly on multiple values.
  5. Next, we used the radians Function on Pie values.
  6. In the Last statement, We used the Radians Function on the String value. It return TypeError as output.

Placed Under: Python

  • Download and Install Python
  • Python Arithmetic Operators
  • Python Assignment Operators
  • Python Bitwise Operators
  • Python Comparison Operators
  • Python Logical Operators
  • Python If Statement
  • Python If Else
  • Python Elif Statement
  • Python Nested If
  • Python For Loop
  • Python While Loop
  • Python Break
  • Python Continue
  • Python Dictionary
  • Python datetime
  • Python String
  • Python Set
  • Python Tuple
  • Python List
  • Python List Comprehensions
  • Python Lambda Function
  • Python Functions
  • Python Types of Functions
  • Python Iterator
  • Python File Handling
  • Python Directory
  • Python Class
  • Python classmethod
  • Python Inheritance
  • Python Method Overriding
  • Python Static Method
  • Connect Python and SQL Server
  • Python SQL Create DB
  • Python SQL Select Top
  • Python SQL Where Clause
  • Python SQL Order By
  • Python SQL Select Statement
  • Python len Function
  • Python max Function
  • Python map Function
  • Python print Function
  • Python sort Function
  • Python range Function
  • Python zip Function
  • Python Math Functions
  • Python String Functions
  • Python List Functions
  • Python NumPy Array
  • NumPy Aggregate Functions
  • NumPy Arithmetic Operations
  • Python Numpy Bitwise operators
  • Numpy Comparison Operators
  • Numpy Exponential Functions
  • Python Numpy logical operators
  • Python numpy String Functions
  • NumPy Trigonometric Functions
  • Python random Array
  • Python numpy concatenate
  • Python numpy Array shape
  • Python pandas DataFrame
  • Pandas DataFrame plot
  • Python Series
  • Python matplotlib Histogram
  • Python matplotlib Scatter Plot
  • Python matplotlib Pie Chart
  • Python matplotlib Bar Chart
  • Python List Length
  • Python sort List Function
  • Python String Concatenation
  • Python String Length
  • Python substring
  • Python Programming Examples

Copyright © 2021 · All Rights Reserved by Suresh

About Us | Contact Us | Privacy Policy