'True / False Python [duplicate]

First Declare a Phrase with uppercase and lowercase, For example :

phrase = "Mike"

Now if you want to find out whether or not the phrase is either upper case or lower case, you would write

print = ( phrase. isupper())

or

print = ( phrase. islower())

Now if you run it will print False.

But how would you make it True?



Solution 1:[1]

Note in the example code in the question, the assignment statements are replacing the built-in print() function.

>>> phrase = "Mike"
>>> print = ( phrase. isupper())
>>> print
False
>>> print('hello')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'bool' object is not callable
>>>
phrase = "Mike"
print(phrase.isupper())
print(phrase.islower())
phrase.upper()
print(phrase.isupper())
phrase = phrase.lower()
print(phrase.islower())

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1