Python' syntax


print “Input a word in English”
input = raw_input()
if type(input) == str:
input[len(input)- 1]=temp
input+= ‘ay’
print (input)
print ‘invalid Data’

where the wrong?


raw_input() takes a string to supply the prompt…

user_input = raw_input(“Input a word in English”)

input is a built in function so should not be used as a variable name.


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