Pyglatin Pop Quiz! Help


#1

I am cut/pasting the code below and it works! However I am trying to get the code to fail by changing the string and I'm still passing

My issue: I am trying to make my code fail by entering a string that contain non-alphabetical characters. For example...I take the string "Enter a word" and I change it to the following "123Enter a word" and the editor is passing me.

Can you tell me where I'm going wrong?

Here is the code that works:

print 'Welcome to the Pig Latin Translator!'
original = raw_input("Enter a word")

Start coding here!

if len(original) > 0 and original.isalpha():
print original
else:
print "empty"


#2

but when you put a number its show you "empty"


#3

Actually when I put in a number it passes and I'm trying to make the code fail. Do you know what I should be doing differently? Here is an example of the code that is passing when I include the number 12

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


#4

modify the print originale by anything else


#5

Hi wizmarco, I changed 'print original' to 'print anything else' and I got it to fail.
I may be totally wrong but it seems like the exercise is calling for me to enter some strings that have non-alphabetical characters. How do I do this?


#6

ok you click on save & submit Code and then put the string.


#7

1) Can you give me one example of a string that contains non-alphabetical characters and one example of an empty string?

2) Can you tell me where it should go in my code?


#8

Try posting something more specific.


#9

No. I just posted that to see if you can post something to help me pass that level. Because I DO NOT understand it!!!


#10

Oh! sorry I just passed that level.:slight_smile::slight_smile:


#11

Also, do you know how to delete a post??:dizzy_face:


#13

x = "J123"
x.isalpha()
This is something you should have posted.