Check Yourself... Some More


#1



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


Oops! Did you accidentally delete the variable named original?


This is the instructions:Use and to add a second condition to your if statement. In addition to your existing check that the string contains characters, you should also use .isalpha() to make sure that it only contains letters.
Don't forget to keep the colon at the end of the if statement!

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

orginal= raw_input("Enter a word:")# Start coding here!
original = ""
if len(original) > 0 and original.isalpha():
print "orginal"
else:
    print "empty"


#2

why do you overwrite the user input with an empty string here:

original = ""

here:

print "orginal"

This line should have indent (4 spaces/tab is common) and you should print the original variable (containing user input) not string original


#3

It still says that Oops! Did you accidentally delete the variable named original?
Here is my code now:

print 'Welcome to the Pig Latin Translator!'
orginal= raw_input("Enter a word:")# Start coding here!
print "orginal"
if len(original) > 0 and original.isalpha():
print "orginal"
else:
    print "empty"

#4

Look at the indentation. That and the first original is spelt wrong.


#5

can you write the correct code out please


#6

print 'Welcome to the Pig Latin Translator!'
original= raw_input("Enter a word:")# Start coding here! # original here was spelt wrong
if len(original) > 0 and original.isalpha():
    print "orginal" # this print statement wasn't indented to be under the if statement.
else:
    print "empty"

Just watch the names on your variables and indentation in future now you know where you went wrong :wink:


#7

That was the same code that I just had


#8

This line changed

orginal= raw_input("Enter a word:")# Was this
original= raw_input("Enter a word:")# Now this, notice original vs orginal

and this line changed:

print "orginal" # was this
   print original#now this, notice indentation  ALSO missed that this was a string, should have been the variable original

EDIT: I originally missed that your print "orginal" line was using a string not a variable, and original was spelt wrong again.


#9

I still wont work at all now this what it says now It looks like your code does not print original ("Hello") when original is only made up of alphabetical characters.

Here is my code:

print 'Welcome to the Pig Latin Translator!'
original= raw_input("Enter a word:")
if len(original) > 0 and original.isalpha():
print "original"
else:
print "empty"


#10

here:

print "original"

you should print the user input which is stored in original variable. Currently you print string "original"


#11

can you write the code out


#12

You should know by now how to print variables, if you don't, go find the exercise where this is explained, or documentation or something

if you don't know how to print variables at this moment, you really need to recap


#13

What @stetim94 means is...

You did this:

print "original"

When you should have done this:

print original

#14

thank you, you are more helpful because I didn't get what he was saying!


#15

He was telling you the same thing I was. He just wanted to get you to figure it out without too much input.


#16

How was it unclear what i was saying?


#17

it worked thank for help @stetim94 and @aquaphoenix17:grinning:


#18

I didn't really understand you very clearly but know I get so thanks for your helping me!


#19

I can't improve upon i didn't understand you very clearly


#20

I didn't understand ok what else can I say to you?