Moving to the nxt exercise


#1

When submit the code it accepts but doesnt move on to the next exercise. The wheel on the save/submit button doesnt stop turing.


#2

It does this because you have made a mistake in your code. You have mistakenly used an infinite loop. What exercise are you on?


#3

I'm on Check urself in PygLatin


#4

What does your code look like


#5

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
raw_input('Daha')
original = raw_input('Daha')
if len(original) > 0:
    # Daha = original.lower()
    first = word(0)
else:
    print 'empty'
if has_chars('Daha') and 'Daha':
    print 'Daha'
else:
    print "empty"

#6
  • In the previous exersize, it says to use 'raw_input("Enter a word: ")'

  • Instead of 'first = word(0)', use 'print(raw_input())'. The instructions ask you to print the users word.

  • You will need parentheses (brackets) before and after 'empty'.

  • You need to use double quotation marks ("") before and after 'empty' and 'Enter a word:'

  • You don't need the second if statement

Hope this helps you


#7

hello,
pls what else is wrong with this code.

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
raw_input("Daha")
original = raw_input("Daha")
if len(original) > 0 and original.isalpha():
    Daha = original.lower()
    print(raw_input("Daha"))
    hama = Daha + first + pyg
    new_Daha = hama[1:]
    print new_word

else:
    print ("empty")

#8

Your code:

My code:

print 'Welcome to the Pig Latin Translator!'

Start coding here!

raw_input("Enter a word: ")
original = raw_input()
if len(original) == True and original.isalpha()> 0:
print(raw_input())
else:
print("empty")

  • I used '== True' after 'len(original)'. I am checking the length of original

  • You don't need:
    Daha = original.lower()
    print(raw_input("Daha"))
    hama = Daha + first + pyg
    new_Daha = hama[1:]
    print new_word

I just wrote print(raw(input)). This is because you want the code to print the word the user enters.

Does it work now?
Are you still on check yourself because it looks like you are on the next exersize


#9

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
raw_input("Daha:")
original = raw_input()
if len(original) == True and original.isalpha()> 0:
    print(raw(input))
else:
    print("empty")

Now what?


#10

Why i'm i getting this error;

Oops, try again. It looks like new_word contains "triangletay" instead of "riangletay"!

here is my code below;

pyg = 'ay'

original = raw_input('Enter a word')

if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
new_word = word + first + pyg
new_word[0: ]
print original
else:
print 'empty'


#11

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