日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

css degrees_带有Python示例的math.degrees()方法

發(fā)布時(shí)間:2023/12/1 python 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 css degrees_带有Python示例的math.degrees()方法 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

css degrees

Python math.degrees()方法 (Python math.degrees() method)

math.degrees() method is a library method of math module, it is used to convert angle value from radians to degree, it accepts a number and returns the angle value in degree.

math.degrees()方法是數(shù)學(xué)模塊的庫方法,用于將角度值從弧度轉(zhuǎn)換為度,它接受一個(gè)數(shù)字并返回以度為單位的角度值。

Note: math.degrees() method accepts only numbers, if we provide anything else except the number, it returns error TypeError – "TypeError: a float is required".

注意: math.degrees()方法僅接受數(shù)字,如果我們提供除數(shù)字以外的任何其他內(nèi)容,它將返回錯(cuò)誤TypeError – “ TypeError:需要浮點(diǎn)數(shù)” 。

Syntax of math.degrees() method:

math.degrees()方法的語法:

math.degrees(x)

Parameter(s): x – is the number in radians to be converted into degree.

參數(shù): x –是要轉(zhuǎn)換為度的弧度數(shù)。

Return value: float – it returns a float value that is the angle value in degree.

返回值: float-它返回一個(gè)浮點(diǎn)值,即以度為單位的角度值。

Example:

例:

Input:x = 10.25# function callprint(math.degrees(x))Output:587.2817400090938

Python代碼演示math.degrees()方法的示例 (Python code to demonstrate example of math.degrees() method)

# Python code to demonstrate example of # math.degrees() method# importing math module import math # number in radians x = 0 print("math.degrees(",x,"): ", math.degrees(x))x = 0.25 print("math.degrees(",x,"): ", math.degrees(x))x = 10.25 print("math.degrees(",x,"): ", math.degrees(x))x = -0.25 print("math.degrees(",x,"): ", math.degrees(x))

Output

輸出量

math.degrees( 0 ): 0.0 math.degrees( 0.25 ): 14.32394487827058 math.degrees( 10.25 ): 587.2817400090938 math.degrees( -0.25 ): -14.32394487827058

TypeError example

TypeError示例

# Python code to demonstrate example of # math.degrees() method with exception# importing math module import math # number in radians x = "10" print("math.degrees(",x,"): ", math.degrees(x))

Output

輸出量

Traceback (most recent call last):File "/home/main.py", line 9, in <module>print("math.degrees(",x,"): ", math.degrees(x)) TypeError: a float is required

翻譯自: https://www.includehelp.com/python/math-degrees-method-with-example.aspx

css degrees

總結(jié)

以上是生活随笔為你收集整理的css degrees_带有Python示例的math.degrees()方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。