日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網營銷解決方案
Python程序:計算數(shù)字立方

創(chuàng)新互聯(lián)python教程:

寫一個 Python 程序,用算術運算符和函數(shù)計算一個數(shù)的立方,并舉例說明。

尋找數(shù)字立方體的 Python 程序

這個 Python 程序允許用戶輸入任何數(shù)值。接下來,Python 使用算術運算符找到該數(shù)字的立方體。

# Python Program to Calculate Cube of a Number

number = float(input(" Please Enter any numeric Value : "))

cube = number * number * number

print("The Cube of a Given Number {0}  = {1}".format(number, cube))

一個數(shù)字輸出的 Python 立方體

 Please Enter any numeric Value : 5
The Cube of a Given Number 5.0  = 125.0

計算數(shù)字立方的 Python 程序示例 2

這個 Python 立方數(shù)的例子同上,但是在這里,我們使用的是指數(shù)算子。

# Python Program to Calculate Cube of a Number

number = float(input(" Please Enter any numeric Value : "))

cube = number ** 3

print("The Cube of a Given Number {0}  = {1}".format(number, cube))
 Please Enter any numeric Value : 10
The Cube of a Given Number 10.0  = 1000.0

用函數(shù)求數(shù)字立方體的 Python 程序

在這個 Python 程序的立方體編號代碼片段中,我們定義了一個函數(shù),它可以找到給定數(shù)字的立方體。

# Python Program to Calculate Cube of a Number

def cube(num):
    return num * num * num

number = float(input(" Please Enter any numeric Value : "))

cub = cube(number)

print("The Cube of a Given Number {0}  = {1}".format(number, cub))


分享文章:Python程序:計算數(shù)字立方
文章路徑:http://m.5511xx.com/article/dhdejgd.html