Python sinh

The Python sinh function calculates the Trigonometric Hyperbolic Sine for the specified expression. In this section, we discuss how to use sinh function in Python Programming language with example.

The basic syntax of the sinh Function in Python Programming Language is

math.sinh(number);

Number: It can be a number or a valid numerical expression for which you want to find hyperbolic Sine value.

  • If the number argument is a positive or negative number, the sinh function returns the Sine value.
  • If the number argument is not a number, the sinh function returns TypeError.

Python sinh Function Example

The Python sinh Function allows you to find the trigonometric Hyperbolic Sine for the numeric values. In this sinh example, We are going to find the hyperbolic Sine values for different data types and display the output.

TIP: Please refer to the Python sin Function article to understand the Sine Function.

# Python SINH Function

import math

Tup = (1, 2, 3, -4 , 5)
Lis = [-1, 2, -3.5, -4 , 5]

print('Hyperbolic Sine value of Positive Number = %.2f' %math.sinh(1))
print('Hyperbolic Sine value of Negative Number = %.2f' %math.sinh(-2))

print('Hyperbolic Sine value of Tuple Item = %.2f' %math.sinh(Tup[3]))
print('Hyperbolic Sine value of List Item = %.2f' %math.sinh(Lis[2]))

print('Hyperbolic Sine value of Multiple Numbers = %.2f' %math.sinh(2 + 9 - 7))

print('Hyperbolic Sine value of String Value = ', math.sinh('Hello'))
Python SINH Function

First, we used the sinh Function directly on both the Positive integer and negative integer. The following statements find the hyperbolic Sine of the corresponding values.

print('Hyperbolic Sine value of Positive Number = %.2f' %math.sinh(1))
print('Hyperbolic Sine value of Negative Number = %.2f' %math.sinh(-2))

Next, We used the sinh Function on Tuple and List items. If you observe the above Python screenshot, the Math function is working perfectly on them.

print('Hyperbolic Sine value of Tuple Item = %.2f' %math.sinh(Tup[3]))
print('Hyperbolic Sine value of List Item = %.2f' %math.sinh(Lis[2]))

Next, We used the sinh Function directly on multiple values.

print('Hyperbolic Sine value of Multiple Numbers = %.2f' %math.sinh(2 + 9 - 7))

Within the last statement, we tried the sinh Function on the String value, and it returns TypeError as output.

print('Hyperbolic Sine value of String Value = ', math.sinh('Hello'))