Need help on upper ()


#1



Replace this line with your code.


#2

Hi, @kristopherskiba ,

Since you have not posted your code, we cannot diagnose the specific problem you are having. Please post it, so that we can take a look at it.

Be sure to format code any time you post it, so we can see important details that may not be visible if it were unformatted. See How do I format code in my posts?.

A method is a function that is part of the definition of a particular type of object. The upper method belongs to the str type, which represents strings. We use dot notation to call methods, in order to get them to execute. This consists of specifying the object from which we wish to call the method, followed by a dot, then by the name of the method, and finally by parentheses, which might be empty, or may contain one or more arguments that are to be passed to the method. For Exercise 7. upper(), you need to call upper without passing it any arguments, so the parentheses will be empty.

Following is an example of one way that we can use the upper method ...

language = "cobol"
print language.upper()

Output ...

COBOL

Now, try a similar approach to the current exercise.

Also see the official Python documentation for str.upper().


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.