a = input("a=")
b = input("b=")
c = int(a) + int(b)
print(c)
結果:
/usr/bin/python3.6 /home/rooter/PycharmProjects/python1/pp1
a=4
b=4
8
Process finished with exit code 0
a = input("a=")
b = input("b=")
c = a + b #或者 c = int (a+b) / c = str (a+b)
print(c)
結果
/usr/bin/python3.6 /home/rooter/PycharmProjects/python1/pp1
a=4
b=5
45
Process finished with exit code 0
money =int(input('你有多少錢?'))
if money > 50:
print ('打車回家')
b = input('到家了嗎?')
if b == '到家了':
print ('我到家了阿')
else :
pass
# else:
# pass
# print('我到家了阿!')
# please = input ('你是男的還是女的?')
# if please == '男的' or '男':
# print('你走吧')
# else :
#
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
