Why I can't use "if len(original) = 0: print "empty" else: print original"?


#1



https://www.codecademy.com/en/courses/python-beginner-2W5v7/0/4?curriculum_id=4f89dab3d788890003000096

File "python", line 5
if len(original) = 0:
^
SyntaxError: invalid syntax


original = raw_input("Enter a word:")
if len(original) = 0:
    print "empty"
else:
    print original

why I can't use this code to print "empty" once length or original var is 0?


#2

Hello @netninja25253,

instead of if len(original) = 0:, it should be if len(original) == 0:

Hope this helps :slight_smile: