Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- def only_lower(s):
- return filter(lambda x: x.islower(), s)
- # Open the file with read only permit
- f = open('FAILEDGG', "r")
- # use readlines to read all lines in the file
- # The variable "lines" is a list containing all lines in the file
- num = 1
- # use readline() to read the first line
- line = f.readline()
- # use the read line to read further.
- # If the file is not empty keep reading one line
- # at a time, till the file is empty
- for line_as_list in line < 20:
- #while num < 10 and line.islower():
- # in python 2+
- # print line
- # in python 3 print is a builtin function, so
- #print(line)
- only_lower(line).join(line_as_list)
- # use realine() to read next line
- print only_lower(line)
- # print(line.rstrip())
- break
- # lower_m = re.findall(exp,lower)
- f.close()
- print only_lower(line)
- **** trying to print out only lowercase words in the whole file print and go to the next one
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement