Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

comprehension

# open the file in read-only mode
file = open("dreams.txt", 'r')
poem = [ line for line in file ]

for line in poem:
    print(line)
Source by www.pythonforbeginners.com #
 
PREVIOUS NEXT
Tagged: #comprehension
ADD COMMENT
Topic
Name
6+9 =