Creating variable and setting it to a string


The instructions are not clear on what to do. "In line 3, create the variable my_string and set it to any string you'd like."

"my_string" = 'something'


a string will be surrounded in either ' ' or " "
A variable name will not.

a_variable = "a string"

Is an example of the format
Variables hold string...amongst other types


it came back with: " 'str' object has no attribute 'length'


copy and paste your code here


my_string = "Hello"
print my_string.length()
print my_string.upper()


Remember string methods


One of your method calls looks different.


The feedback is quite unclear, but are you referencing how i made the 1st line of code?


I'm telling you that you're calling the method to determine the length of string incorrectly.

length() isn't a thing, how does the example show you to do this?


Ok thanks for the clarification.


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