Python' syntax


#1

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

where the wrong?


#2

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.


#3

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