226k views
5 votes
Given a variable s associated with a str, write an expression whose value is a str that is identical except that all the letters in it are upper-case. Thus, if the str associated with s were "McGraw15", the value of the expression would be "MCGRAW15".

User BSQ
by
4.8k points

1 Answer

6 votes

Answer:

following are expression to this question:

s.upper()

Step-by-step explanation:

Example to use upper method:

s= "McGraw15" #defining string variable that holds a value

print (s) #print value

print ('changing into upper case: ') #print message

print (s.upper()) # call upper method and print its value

Output:

McGraw15

changing into upper case:

MCGRAW15

Description of upper method:

  • In the given question it is defined, that "s" is a string variable, that holds a string value, and variable "s" uses a method to convert all the string value into upper-case.
  • To convert all value into the upper case the "upper()" method is used, It is a built-in method, that converts all the value in the upper-case.

User DicBrus
by
5.8k points