Input


#1

print 'Welcome to the Pig Latin Translator!'

Start coding here!

original =raw_input (" Enter a word")

 if original > 0:
  print original
 else original <=0:
  print "empty"

its giving indentation error please help


#3

Example of getting input from a user:

original = raw_input("Enter a word")

#4

print 'Welcome to the Pig Latin Translator!'

Start coding here!

original =raw_input (" Enter a word")

 if original > 0:
  print original
 else original <=0:
  print "empty"

yes im doing this and its giving indentation error


#5

Merged duplicate topics, @mtf's reply doesn't make overly much sense in its new context, that's kinda my fault.

@saadiasaadat If you're gonna ask about your indentation you better make sure others can see how you indented your code. And, please only create one topic per discussion


#6

Python relies on indentation to tell it where the blocks begin and end. It appears your code is not checking the length of the input string.

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

Note the indentatron of 4 spaces.


#7

It still goes to the heading, so no harm done.


#8

Thank you so much , sorry for creating same topic twice.


#9

lol ok so I had no idea what I did here... I don't get why is it "original" (Can someone explain?)... lol. This was my code that worked:

print 'Welcome to the Pig Latin Translator!'

original = raw_input("Are those original?")


#10

The name of the variable is arbitrary, but it is descriptive of its role in the program. original was chosen by the author to represent the original user input. This variable will remain unchanged so the user input will be intact at the end of the program run.

The next step in the program will be to validate the user input. After that, the value will be copied to a new working variable.