8. Word Up - not sure where the mistake is


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/en/courses/learn-python/lessons/pyglatin/exercises/word-up

<In what way does your code behave incorrectly? Include ALL error messages.>
File “python”, line 8
print original
^
IndentationError: unindent does not match any outer indentation level

<What do you expect to happen instead?>
Instead, I expected any word in capital letters to be printed in lower. For example BOOK to book



pyg = 'ay'

original = raw_input('Enter a word:')

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



#2

Inconsistent indentation will always be a problem in Python. Be sure to keep all indentations in line with each so the block is contiguous.


#3

Hi, thank you for your help. I changed code to this:

pyg = 'ay'

original = raw_input('Enter a word:')

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

and now the part with variables “word” and “first” doesn’t work which means that when I enter the word in capital letters still got printed only that word in capital letters.
Please advise. :slight_smile:


#4

original does not get changed, only the copy that is made and cached in word gets the case change.

Let original equal “CAPITAL”

print original    # CAPITAL
print word        # capital

#5

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