Here is the example code that demonstrates the problem (Python 3.6).
import telnetlib hostname = input("Enter hostname: ") try: print(hostname