Answer to Question #205323 in Python for ayushi

Question #205323

while run this code

input: python

and it show out is :

kbgslm



Errors/Warnings:

Traceback (most recent call last):

 File "main.py", line 8, in <module>

  inp = input()

EOFError: EOF when reading a line



expected output:

kbgslm



1
Expert's answer
2021-06-10T07:44:09-0400
"""
Unfortunately, the full program code has not been provided.
 EOFError: EOF when reading a line
Probable causes and solutions:
-used by python 2 version
replace 'input' to 'raw_input'
- inp = input() possibly included in the loop and does not receive a value
consider loop conditions or process a condition when inp is None
Below is the code that mirrors the entered string
"""
abc = 'abcdefghijklmnopqrstuvwxyz'
inp = input('Enter your string: ')
out = ''.join([i if abc.find(i) == -1 else abc[25 - abc.find(i)] for i in inp.lower()])
print(out)


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS