Programming Fonts
programmingfonts.org
programmingfonts.org
I've been using the same 2 fonts for maybe five years and recently got confused looking at a lowercase "L" or a one (1).
Cool website.
For python, this is not a problem, as consistent indentation is important, but alignment is not (I use proportional fonts for Python and YAML all the time, and the only problem is how annoying the ASCII Art labels someone put in some of our YAML are without consistent alignment.)
Typewriters had no way of adjusting kerning pairs. The space between ho and lo are different in proportional fonts. These are called kerning pairs. So, it was mechanically easier to make letters of same width.
Code is monospaced for many reasons others have replied here.
Because computers used to display exclusively in monospaced fonts and coding adapted to that, including use of character position in lines for visual alignment. There've been more recent moves away from that (both elastic tabstops and indent-only-and-never-align are approaches) but they haven't become universal so if you ever deal with code that isn't from a tightly controlled group with practices against position-based-alignment, you are going to run into code that uses it.