I am playing first time with input in python and getting some error on this code:
import random
x = input("Name of the File? ")
lines = open(x).read().splitlines()
myline =random.choice(lines)
print(myline)
when I run it, it ask me for name.. then I enter: data.txt and getting this error:
NameError: name 'data' is not defined