Python isupper

Python isupper 函数可用于检查给定字符串是否至少包含一个字符,以及该字符是大写还是小写。如果它是大写字母,则 isupper 函数返回 true;否则返回 false。

本节将讨论在此编程语言中如何编写 isupper 函数,示例如下。

String_Value.isupper()

isupper 函数示例

以下示例集可帮助您理解 isupper 函数。请参阅 StringMethods 文章,以了解它们。

Str1 = 'TUTORIAL GATEWAY';
print('First Output of a method is = ', Str1.isupper())

# Performing on Empty Space
Str2 = '     ';
print('Second Output For Empty Space is = ', Str2.isupper())

# Performing directly on Alphabets
Str3 = 'PYTHON LANGUAGE tutorial at Tutorial GatewaY'.isupper()
print('Third Output  is = ', Str3)

# Performing both Digits and Alphabets
Str4 = '139ABCD'.isupper()
print('Fourth Output is = ', Str4)

# Performing on Special Characters
Str5 = '!!!@@@'.isupper()
print('Fifth Output is = ', Str5)

# Using on Both Alphabets & Special Characters
Str6 = 'ABCDS!!!@@@'.isupper()
print('Sixth Output is = ', Str6)
string isupper function Example