This sucks


#1

No idea what I'm doing wrong. Typing my code exactly as instructed, still getting it wrong.

Write your code below, starting on line 3!

my_string = black
print len(my_string
print .upper(my_string)

On line 3, create the variable my_string and set it to any string you'd like.
On line 4, print the length of my_string.
On line 5, print the .upper() case version of my_string.


#2

Hello @wizard90,
When we work with texts in python,We don't just use it but we surround them using double or single quotes (You can even use triple quotes) like this..

name = "GreenTree" #doublequote
or
name = 'GreenTree' #singlequote
or
name = """GreenTree""" #triplequote
or even
name = '''GreenTree'''

for python all of them are same.
when python executes your program and sees quotes "It says ,Oh it's a starting of text and when it hits end quote of string it understands that text has just ended"
That's how python works with texts.

You need to surround your text black inside pair of quotes.

also this..

print len(my_string < -- missed the closing bracket.
If brackets starts with ( , it must be closed with ).

also check this..

print .upper(my_string)

read theory again and give it another try,If you get confusion, point them out,I will explain.


#3

Yea, I figured it out. Thanks!


#4

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