Python if len("string") <= 1: how to print the word? @codeacademy -


print "welcome english pig latin translator!" original = raw_input ("type word want translate!")  def pytranslator():     if len("string") <= 1:         print original     else:         return "empty" 

i want print word if has more 1 (1) letter. i've tried

return true print original 

you testing length of wrong thing. test original instead:

if len(original) <= 1:     print original 

len("string") always going 6, number of characters in value "string":

>>> len("string") 6 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -