6
AssignmentMultiple Choice

Write Password Evaluator

Question 6 • Introduction to Computer Science B – 4-232

Which string method returns true if the character is an uppercase letter? letter = input("Enter a letter: ")

Answer
A
letter.isUpper()
B
letter.isupper()
C
isupper(letter)
D
isUpper(letter)

Explanation

In Python, `isupper()` is a string method that returns `True` when the string contains an uppercase letter and no lowercase letters. Since `letter` is a string, call the method on it as `letter.isupper()`. The correct choice is B, `letter.isupper()`; Python method names are case-sensitive, so `isUpper()` is not valid.

AI-written and checked against the verified answer.