If you’re still printing the original variable, then you should expect to see the original input string printed to the console. To see the string we’ve made some changes to by now, we need to print the variable we want to see displayed to the screen. For example:
“Traceback (most recent call last):
File “python”, line 3, in
ExecTimeoutException: Program took too long to terminate.”
This is what I have been getting while working in this entire section of PYGLATIN
If the program will not accept inputs in the console, then bypass the prompt (comment it out) and assign a literal string to the variable. Then run the program with that.
Which of the variables to be specific? And I can’t seem to to get any result on the console prompt if I enter a word, which I’ve tried severally in capital letters. I use google chrome.
Checked it a few times. it seems to bug on the .lower
That leads to
–>Traceback (most recent call last):
File “python”, line 7, in
TypeError: unsupported operand type(s) for +: ‘builtin_function_or_method’ and ‘unicode’
found out there was just a syntax error at my side. in the .lower
For me I was stuck for a bit because every time I would run it it would print the word i did before and not the current one that I just entered. So I fixed it by moving the print to below the rest of the indented code like this (I just put this here for others i case they have the same problem):
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
print new_word
I still cannot get past this prompt. I have tried everything – my roommate who is a data scientist and uses Python every single say also cant figure out whats going on.
Try switching out the print original to print new_word at the end of the if statement. It should change what you typed in the prompt. Also, don’t forget to indent the new variables under the if statement. Hope this helps.
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