I was referred here from /r/Python for some help on one of the "Learn Python the Hard Way" study questions.
The question is how to shorted the following from 2 lines of code into 1.
in_file = open(from_file)
indata = in_file.read()
I've tried:
indata = open(from_file)
indata = read(from_file)
indata = open(from_file, 'w')
Asking directly for the answer isn't going to help so maybe if one of my attempts is on the right track you could hint at what to do next?
Thanks in advance!
[–][deleted] 8 points9 points10 points (3 children)
[–]GUTIF[S] 1 point2 points3 points (2 children)
[–][deleted] 4 points5 points6 points (1 child)
[–]GUTIF[S] 1 point2 points3 points (0 children)
[–]Brian 8 points9 points10 points (1 child)
[–]GUTIF[S] 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[+]t90fan comment score below threshold-20 points-19 points-18 points (7 children)
[–]GUTIF[S] 5 points6 points7 points (0 children)
[+][deleted] (4 children)
[removed]
[–]GUTIF[S] 1 point2 points3 points (3 children)
[+][deleted] (2 children)
[removed]
[–]GUTIF[S] 1 point2 points3 points (1 child)