UCL-EO / geog0111

UCL MSc coursenotes
http://www2.geog.ucl.ac.uk/~plewis/geog0111
GNU General Public License v3.0
16 stars 18 forks source link

small error in Exercise 3 in Notebook 015 Control in Python: if #15

Closed wanxinyang closed 3 years ago

wanxinyang commented 3 years ago

In Exercise 3 in Notebook 015 Control in Python: if

line 16: month = 'out of bounds error: doy='+doy

The last variable 'doy' is integer and cannot be concatenated with string. The solution would be converting 'doy' into string type: month = 'out of bounds error: doy=' + str(doy)

profLewis commented 3 years ago

Changed to month = f'out of bounds error: doy={doy}' which doesn’t rely on type of doy being string