日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

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

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Python程序:連接字符串

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

寫一個(gè) Python 程序,用一個(gè)實(shí)際例子連接字符串。

連接字符串的 Python 程序示例 1

這個(gè) Python 程序允許用戶輸入兩個(gè)不同的字符串。接下來,我們使用算術(shù)運(yùn)算符【T1+】來連接這兩個(gè)字符串。

# Python Program to Concatenate Strings

str1 = input("Please Enter the First  String : ")
str2 = input("Please Enter the Second String : ")

concat1 = str1 + str2
print("The Final String After Python String Concatenation = ", concat1)

concat2 = str1 + ' ' + str2
print("The Final After String Concatenation with Space = ", concat2)

連接字符串的 Python 程序示例 2

如果要連接字符串文字,可以使用以下方法。這兩種 Python 方法都意味著工作,無論有沒有括號(hào)。

# Python Program to Concatenate Strings

concat1 = 'Tutorial ' 'Gateway'
print("The Final String = ", concat1)

concat2 = ('Python ' 'Programming ' 'Examples')
print("The Final String = ", concat2)

Python 字符串串聯(lián)輸出

The Final String =  Tutorial Gateway
The Final String =  Python Programming Examples

網(wǎng)站欄目:Python程序:連接字符串
文章網(wǎng)址:http://www.dlmjj.cn/article/djhcshg.html