How 2 print length?


stuck on "and now for something completely familiar">

print my_string str(3)
my_string.upper() doesn't work


String objects are text inside quotes.

"this is a string"

'so is this'

To assign a string value to a variable, we start with,

my_string =

and write the string on the right hand side...

my_string = "and now for something completely familiar"

To determine the length of a string we use the len() function...

print len(my_string)

Now your last line will also work...

print my_string.upper()


stuck plz help im very new
my_string =1.23
print "%s, %s" % my_string str(3) "my_string".upper()
and it told me to put it in upper case but i don't know what's wrong


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