av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

Python程序:檢查字符是否是字母

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

用一個(gè)實(shí)際例子寫一個(gè) Python 程序來檢查字符是否是字母。

Python 程序檢查字符是否是字母

這個(gè) python 程序允許用戶輸入任何字符。接下來,我們使用 If Else 語句來檢查用戶給定的字符是否是字母表。這里 If 語句檢查字符是在 A 和 z 之間還是在 A 和 z 之間,如果是 TRUE,則是字母表;否則,它就不是字母表。

# Python Program to check character is Alphabet or not
ch = input("Please Enter Your Own Character : ")

if((ch >= 'a' and ch <= 'z') or (ch >= 'A' and ch <= 'Z')):
    print("The Given Character ", ch, "is an Alphabet")
else:
    print("The Given Character ", ch, "is Not an Alphabet")

Python 字符是字母還是不輸出

Please Enter Your Own Character : q
The Given Character  q is an Alphabet
>>> 
Please Enter Your Own Character : 8
The Given Character  8 is Not an Alphabet

Python 程序使用 ASCII 值驗(yàn)證字符是否是字母

在這個(gè) Python 代碼中,我們使用 If Else 語句中的 ASCII 值來檢查字符是否是字母表。

# Python Program to check character is Alphabet or not
ch = input("Please Enter Your Own Character : ")

if((ord(ch) >= 65 and ord(ch) <= 90) or (ord(ch) >= 97 and ord(ch) <= 122)):
    print("The Given Character ", ch, "is an Alphabet")
else:
    print("The Given Character ", ch, "is Not an Alphabet")
Please Enter Your Own Character : W
The Given Character  W is an Alphabet
>>> 
Please Enter Your Own Character : #
The Given Character  # is Not an Alphabet

尋找字符的 Python 程序是使用 isalpha 函數(shù)的字母表

在這個(gè)例子 python 代碼中,我們使用 isalpha 字符串函數(shù)來檢查給定的字符是否是字母表。

# Python Program to check character is Alphabet or not
ch = input("Please Enter Your Own Character : ")

if(ch.isalpha()):
    print("The Given Character ", ch, "is an Alphabet")
else:
    print("The Given Character ", ch, "is Not an Alphabet")


當(dāng)前文章:Python程序:檢查字符是否是字母
文章出自:http://uogjgqi.cn/article/dpshepp.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們在微信上24小時(shí)期待你的聲音

解答本文疑問/技術(shù)咨詢/運(yùn)營咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流