回答編集履歴
2
f
    
        answer	
    CHANGED
    
    | 
         @@ -3,7 +3,7 @@ 
     | 
|
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            ```python
         
     | 
| 
       5 
5 
     | 
    
         
             
            with open('TextB.txt') as f:
         
     | 
| 
       6 
     | 
    
         
            -
                lines =  
     | 
| 
      
 6 
     | 
    
         
            +
                lines = f.read().splitlines()  # 改行で分割する。
         
     | 
| 
       7 
7 
     | 
    
         
             
                text = ' '.join(lines)  # 空白で結合する。
         
     | 
| 
       8 
8 
     | 
    
         
             
            print(text)
         
     | 
| 
       9 
9 
     | 
    
         
             
            ```
         
     | 
1
d
    
        answer	
    CHANGED
    
    | 
         @@ -3,8 +3,7 @@ 
     | 
|
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            ```python
         
     | 
| 
       5 
5 
     | 
    
         
             
            with open('TextB.txt') as f:
         
     | 
| 
       6 
     | 
    
         
            -
                data = ''
         
     | 
| 
       7 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                lines = a.splitlines()  # 改行で分割する。
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
      
 7 
     | 
    
         
            +
                text = ' '.join(lines)  # 空白で結合する。
         
     | 
| 
       9 
     | 
    
         
            -
            print( 
     | 
| 
      
 8 
     | 
    
         
            +
            print(text)
         
     | 
| 
       10 
9 
     | 
    
         
             
            ```
         
     |