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

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

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Python程序:檢查字符是否大寫

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

創(chuàng)新互聯(lián)建站公司2013年成立,先為鶴城等服務(wù)建站,鶴城等地企業(yè),進行企業(yè)商務(wù)咨詢服務(wù)。為鶴城企業(yè)網(wǎng)站制作PC+手機+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問題。

寫一個 Python 程序,用一個實例來檢查字符是否大寫。

使用映射函數(shù)檢查字符是否大寫的 Python 程序

在這個 Python 示例中,我們使用 isupper 字符串函數(shù)來檢查給定字符是否大寫。

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

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

Python 大寫字符或不輸出

Please Enter Your Own Character : I
The Given Character  I is an Uppercase Alphabet
>>> 
Please Enter Your Own Character : j
The Given Character  j is Not an Uppercase Alphabet

Python 程序查找字符是否大寫

這個 python 程序允許用戶輸入任何字符。接下來,我們使用 If Else 語句來檢查用戶給定的字符是否大寫。這里, If 語句 (ch > = 'A '和 ch < = 'Z ')檢查字符是否大于等于 A,如果為 TRUE 則小于等于 Z,為大寫。否則,它不是大寫字符。

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

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

使用 ASCII 值驗證字符是否大寫的 Python 程序

在這段 Python 代碼中,我們使用 ASCII 值來檢查字符是否大寫。

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

if(ord(ch) >= 65 and ord(ch) <= 90):
    print("The Given Character ", ch, "is an Uppercase Alphabet")
else:
    print("The Given Character ", ch, "is Not an Uppercase Alphabet")
Please Enter Your Own Character : p
The Given Character  p is Not an Uppercase Alphabet
>>> 
Please Enter Your Own Character : T
The Given Character  T is an Uppercase Alphabet

網(wǎng)站欄目:Python程序:檢查字符是否大寫
網(wǎng)頁路徑:http://www.5511xx.com/article/coghjde.html