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

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

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
Python程序:打印字符串中的字符

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

寫(xiě)一個(gè) Python 程序來(lái)打印字符串中的字符,并給出一個(gè)實(shí)例。

打印字符串中的字符的 Python 程序示例 1

這個(gè) python 程序允許用戶輸入一個(gè)字符串。接下來(lái),它使用 For 循環(huán)打印該字符串中的字符。這里,我們使用 For 循環(huán)來(lái)迭代字符串中的每個(gè)字符。在 Python For 循環(huán)中,我們使用 print 語(yǔ)句打印該字符串中的字符。

提示:請(qǐng)參考字符串文章,了解 Python 中關(guān)于字符串的一切。

# Python program to Print Characters in a String

str1 = input("Please Enter your Own String : ")

for i in range(len(str1)):
    print("The Character at %d Index Position = %c" %(i, str1[i]))

返回字符串中的字符的 Python 程序示例 2

這個(gè) python 程序顯示字符串中的字符同上。然而,我們只是將換成了同時(shí)換成了。

# Python program to Print Characters in a String

str1 = input("Please Enter your Own String : ")
i = 0

while(i < len(str1)):
    print("The Character at %d Index Position = %c" %(i, str1[i]))
    i = i + 1

Python 打印字符串輸出

Please Enter your Own String : Tutorial Gateway
The Character at 0 Index Position = T
The Character at 1 Index Position = u
The Character at 2 Index Position = t
The Character at 3 Index Position = o
The Character at 4 Index Position = r
The Character at 5 Index Position = i
The Character at 6 Index Position = a
The Character at 7 Index Position = l
The Character at 8 Index Position =  
The Character at 9 Index Position = G
The Character at 10 Index Position = a
The Character at 11 Index Position = t
The Character at 12 Index Position = e
The Character at 13 Index Position = w
The Character at 14 Index Position = a
The Character at 15 Index Position = y

新聞名稱:Python程序:打印字符串中的字符
網(wǎng)站URL:http://www.5511xx.com/article/cddsphi.html