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

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

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Python程序:兩個數(shù)相減

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

創(chuàng)新互聯(lián)專注于昆山企業(yè)網(wǎng)站建設(shè),成都響應(yīng)式網(wǎng)站建設(shè)公司,成都做商城網(wǎng)站。昆山網(wǎng)站建設(shè)公司,為昆山等地區(qū)提供建站服務(wù)。全流程按需設(shè)計網(wǎng)站,專業(yè)設(shè)計,全程項目跟蹤,創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務(wù)

寫一個 Python 程序來減去兩個數(shù)字。

num1 = 128
num2 = 256

sub = num1 - num2
print('The Result of subtracting {0} from {1} = {2}'.format(num2,num1,sub))
The Result of subtracting 256 from 128 = -128

這個 Python 程序接受兩個整數(shù)值,并從另一個數(shù)中減去一個數(shù)。

num1 = int(input("Please Enter the First Number  = "))
num2 = int(input("Please Enter the second number = "))

sub = num1 - num2
print('The Result of subtracting {0} from {1} = {2}'.format(num2,num1,sub))

其他產(chǎn)出很少

Please Enter the First Number  = 11
Please Enter the second number = 43
The Result of subtracting 43 from 11 = -32

Please Enter the First Number  = 99
Please Enter the second number = 23
The Result of subtracting 23 from 99 = 76

Python 編程使用函數(shù)減去兩個數(shù)。

def subtractTwoNum(a, b):
    return a - b

num1 = int(input("Please Enter the First Number  = "))
num2 = int(input("Please Enter the second number = "))

sub = subtractTwoNum(num1, num2)
print('The Result of subtracting {0} from {1} = {2}'.format(num2,num1,sub))
Please Enter the First Number  = 12
Please Enter the second number = 49
The Result of subtracting 49 from 12 = -37

Please Enter the First Number  = 70
Please Enter the second number = 37
The Result of subtracting 37 from 70 = 33

分享名稱:Python程序:兩個數(shù)相減
標(biāo)題鏈接:http://www.5511xx.com/article/djpdihj.html