I'm new to programming. I'm supposed to make a function that reads only dates and temperatures from the file. I would really appreciate the help. Thanks in advance.

```
def read_data(text):
    data = open(text, 'r')
    for line in data:
        split_data = line.split(',')
        if line.isdigit():
            date = split_data[1]
            temperature = split_data[2]
            full_data = date + temperature
        data.close
    return full_data
max_dates, max_temps = read_data('DeBiltTempMax2022.txt')

```

this is the sample of the text file:

```
  EUROPEAN CLIMATE ASSESSMENT & DATASET (ECA&D), file created on 23-05-2022
THESE DATA CAN BE USED FREELY PROVIDED THAT THE FOLLOWING SOURCE IS ACKNOWLEDGED:

Klein Tank, A.M.G. and Coauthors, 2002. Daily dataset of 20th-century surface
air temperature and precipitation series for the European Climate Assessment.
Int. J. of Climatol., 22, 1441-1453.
Data and metadata available at http://www.ecad.eu

FILE FORMAT (MISSING VALUE CODE IS -9999):

01-06 SOUID: Source identifier
08-15 DATE : Date YYYYMMDD
17-21 TX   : maximum temperature in 0.1 &#176;C
23-27 Q_TX : Quality code for TX (0='valid'; 1='suspect'; 9='missing')

This is the blended series of station NETHERLANDS, DE BILT (STAID: 162).
Blended and updated with sources: 100522 906260 
See file sources.txt and stations.txt for more info.

 SOUID,    DATE,   TX, Q_TX
100522,19010101,  -24,    0
100522,19010102,  -14,    0
100522,19010103,   -6,    0
100522,19010104,  -11,    0
100522,19010105,  -20,    0
100522,19010106,  -80,    0
100522,19010107,  -68,    0
100522,19010108,   -7,    0
100522,19010109,   44,    0
100522,19010110,   61,    0
100522,19010111,   51,    0
100522,19010112,  -20,    0
100522,19010113,  -20,    0
100522,19010114,   31,    0
100522,19010115,   54,    0
100522,19010116,   42,    0
100522,19010117,   65,    0
100522,19010118,   43,    0
100522,19010119,   64,    0

```