Question
Having some trouble with this python problem. An answer would be greatly appreciated! the_string = I'm a Ramblin' Wreck #You may modify the lines of
Having some trouble with this python problem. An answer would be greatly appreciated!
the_string = "I'm a Ramblin' Wreck"
#You may modify the lines of code above, but don't move them! #When you Submit your code, we'll change these lines to #assign different values to the variables. # #Write some code that will capitalize and print the value of #the_string. For example, for the initial value of the_string #above, it should print "I'M A RAMBLIN' WRECK". # #You can capitalize a string by calling the_string.upper(). #This will return a capitalized version of the string. (Note #that this will _not_ modified the_string, but rather just #return the result if it were to be capitalized.) # #However, the_string might not actually be a string! It might #be an integer, a float, or something else. If that happens, #then calling the_string.upper() will cause an AttributeError #to occur. Catch this error and print "The variable was not #a string!" # #Note that you may not use any conditionals in your answer. #Note also that you should not assume that every error that #occurs is an Attribute Error! Any other errors should #not be caught.
#Add your code here!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started