Stuck - Obviously Newbie


#1



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


It says my code looks a bit off. Check the Hint for help. This is what I see from the box on the top right for the Pig Latin thing:

Welcome to the Pig Latin Translator!
Prompt the_string
Prompt the_string
Traceback (most recent call last):
File "python", line 7, in
NameError: name 'has_chars' is not defined

I don't know how to define has_chars


Replace this line with your code. 
print 'Welcome to the Pig Latin Translator!'

# Start coding here!
variable_name = raw_input('Prompt')
original = raw_input('Prompt')

if has_chars(the_string) and the_string.isalpha():
    print the_string
else: 
    print "empty"


#2

original is your variable name? You only need on prompt

to determine if the string has characters, check if the length (len()) is greater then (>) zero (0)

original is your string? so check if original is alpha


#3

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